Added components to article
This commit is contained in:
@ -71,28 +71,31 @@ class _DeliveryAppState extends State<DeliveryApp> {
|
||||
),
|
||||
],
|
||||
child: MaterialApp(
|
||||
home: OperationViewEnforcer(
|
||||
child: BlocBuilder<AppBloc, AppState>(
|
||||
builder: (context, state) {
|
||||
if (state is AppConfigLoading) {
|
||||
return Scaffold(
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
// Wrap the Navigator (not just the home route) so the loading
|
||||
// overlay covers every pushed route — DeliveryDetail, Cars,
|
||||
// dialogs, etc. — not only the initial home tree.
|
||||
builder: (context, child) =>
|
||||
OperationViewEnforcer(child: child ?? const SizedBox.shrink()),
|
||||
home: BlocBuilder<AppBloc, AppState>(
|
||||
builder: (context, state) {
|
||||
if (state is AppConfigLoading) {
|
||||
return Scaffold(
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
|
||||
if (state is AppConfigLoadingFailed) {
|
||||
return Scaffold(body: Center(child: Text(state.message)));
|
||||
}
|
||||
if (state is AppConfigLoadingFailed) {
|
||||
return Scaffold(body: Center(child: Text(state.message)));
|
||||
}
|
||||
|
||||
if (state is AppConfigLoaded) {
|
||||
return LoginEnforcer(
|
||||
child: CarSelectionEnforcer(child: Home()),
|
||||
);
|
||||
}
|
||||
if (state is AppConfigLoaded) {
|
||||
return LoginEnforcer(
|
||||
child: CarSelectionEnforcer(child: Home()),
|
||||
);
|
||||
}
|
||||
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
routes: {"/cars": (context) => CarManagementPage()},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user