Skip to content

Commit 29224a5

Browse files
committed
feat(status): add global maintenance and update required checks
- Add MaintenancePage and UpdateRequiredPage to app dependencies - Implement global checks for maintenance mode and required updates - Prioritize these checks above RemoteConfig loading states - Lock UI if app is under maintenance or requires an update
1 parent 12358a5 commit 29224a5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/app/view/app.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:flutter_news_app_mobile_client_full_source_code/app/services/dem
1111
import 'package:flutter_news_app_mobile_client_full_source_code/authentication/bloc/authentication_bloc.dart';
1212
import 'package:flutter_news_app_mobile_client_full_source_code/l10n/app_localizations.dart';
1313
import 'package:flutter_news_app_mobile_client_full_source_code/router/router.dart';
14+
import 'package:flutter_news_app_mobile_client_full_source_code/status/view/view.dart';
1415
import 'package:go_router/go_router.dart';
1516
import 'package:kv_storage_service/kv_storage_service.dart';
1617
import 'package:ui_kit/ui_kit.dart';
@@ -196,6 +197,25 @@ class _AppViewState extends State<_AppView> {
196197
// Defer l10n access until inside a MaterialApp context
197198

198199
// Handle critical RemoteConfig loading states globally
200+
// These checks have the highest priority and will lock the entire UI.
201+
//
202+
// Check for Maintenance Mode.
203+
if (state.status == AppStatus.underMaintenance) {
204+
return const MaterialApp(
205+
debugShowCheckedModeBanner: false,
206+
home: MaintenancePage(),
207+
);
208+
}
209+
210+
// Check for a Required Update.
211+
if (state.status == AppStatus.updateRequired) {
212+
return const MaterialApp(
213+
debugShowCheckedModeBanner: false,
214+
home: UpdateRequiredPage(),
215+
);
216+
}
217+
218+
// Check for Config Fetching state.
199219
if (state.status == AppStatus.configFetching) {
200220
return MaterialApp(
201221
debugShowCheckedModeBanner: false,

lib/status/view/view.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export 'maintenance_page.dart';
2+
export 'update_required_page.dart';

0 commit comments

Comments
 (0)