Skip to content

Commit b32a5c3

Browse files
committed
feat(app_configuration): add push notification settings form
- Import PushNotificationSettingsForm widget - Update TabController length to 4 - Add new tab for notifications configuration - Implement PushNotificationSettingsForm in AppConfigurationPage
1 parent 192ea6a commit b32a5c3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/app_configuration/view/app_configuration_page.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuratio
44
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/view/tabs/advertisements_configuration_tab.dart';
55
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/view/tabs/feed_configuration_tab.dart';
66
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/view/tabs/general_configuration_tab.dart';
7+
import 'package:flutter_news_app_web_dashboard_full_source_code/app_configuration/widgets/push_notification_settings_form.dart';
78
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
89
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/widgets/about_icon.dart';
910
import 'package:ui_kit/ui_kit.dart';
@@ -30,7 +31,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
3031
@override
3132
void initState() {
3233
super.initState();
33-
_tabController = TabController(length: 3, vsync: this);
34+
_tabController = TabController(length: 4, vsync: this);
3435
context.read<AppConfigurationBloc>().add(const AppConfigurationLoaded());
3536
}
3637

@@ -68,6 +69,7 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
6869
Tab(text: l10n.generalTab),
6970
Tab(text: l10n.feedTab),
7071
Tab(text: l10n.advertisementsTab),
72+
Tab(text: l10n.notificationsTab),
7173
],
7274
),
7375
),
@@ -156,6 +158,14 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
156158
);
157159
},
158160
),
161+
PushNotificationSettingsForm(
162+
remoteConfig: remoteConfig,
163+
onConfigChanged: (newConfig) {
164+
context.read<AppConfigurationBloc>().add(
165+
AppConfigurationFieldChanged(remoteConfig: newConfig),
166+
);
167+
},
168+
),
159169
],
160170
);
161171
}

0 commit comments

Comments
 (0)