Skip to content

Commit d43720d

Browse files
committed
feat(app_configuration): add advertisements configuration tab
- Create new tab for ad settings in App Configuration page - Implement AdvertisementsConfigurationTab widget - Add AdConfigForm to handle ad settings input - Include localization support for tab content
1 parent 9c51241 commit d43720d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import 'package:core/core.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/widgets/ad_config_form.dart';
4+
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
5+
import 'package:ui_kit/ui_kit.dart';
6+
7+
/// {@template advertisements_configuration_tab}
8+
/// A widget representing the "Advertisements" tab in the App Configuration page.
9+
///
10+
/// This tab allows configuration of various ad settings.
11+
/// {@endtemplate}
12+
class AdvertisementsConfigurationTab extends StatelessWidget {
13+
/// {@macro advertisements_configuration_tab}
14+
const AdvertisementsConfigurationTab({
15+
required this.remoteConfig,
16+
required this.onConfigChanged,
17+
super.key,
18+
});
19+
20+
/// The current [RemoteConfig] object.
21+
final RemoteConfig remoteConfig;
22+
23+
/// Callback to notify parent of changes to the [RemoteConfig].
24+
final ValueChanged<RemoteConfig> onConfigChanged;
25+
26+
@override
27+
Widget build(BuildContext context) {
28+
final l10n = AppLocalizationsX(context).l10n;
29+
30+
return ListView(
31+
padding: const EdgeInsets.all(AppSpacing.lg),
32+
children: [
33+
// Top-level ExpansionTile for Ad Settings
34+
ExpansionTile(
35+
title: Text(l10n.adSettingsTitle),
36+
childrenPadding: const EdgeInsets.symmetric(
37+
horizontal: AppSpacing.xxl,
38+
),
39+
children: [
40+
AdConfigForm(
41+
remoteConfig: remoteConfig,
42+
onConfigChanged: onConfigChanged,
43+
),
44+
],
45+
),
46+
],
47+
);
48+
}
49+
}

0 commit comments

Comments
 (0)