mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
removed snackbar calling in any place in the app except in the intercepter to improve
readability and reduce duplication of error message display logic.
This commit is contained in:
@ -20,11 +20,11 @@ class AppLayout extends StatelessWidget {
|
||||
return BlocConsumer<AuthCubit, AuthState>(
|
||||
listener: (context, state) {
|
||||
if (state is AuthError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.message),
|
||||
),
|
||||
);
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// SnackBar(
|
||||
// content: Text(state.message),
|
||||
// ),
|
||||
// );
|
||||
Navigator.of(context)
|
||||
.popUntil((route) => route.settings.name == Routes.authLogin);
|
||||
}
|
||||
@ -35,11 +35,11 @@ class AppLayout extends StatelessWidget {
|
||||
child: BlocConsumer<HomeCubit, HomeState>(
|
||||
listener: (context, state) async {
|
||||
if (state is GetSpacesError) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.errMessage),
|
||||
),
|
||||
);
|
||||
// ScaffoldMessenger.of(context).showSnackBar(
|
||||
// SnackBar(
|
||||
// content: Text(state.errMessage),
|
||||
// ),
|
||||
// );
|
||||
Navigator.of(context).popUntil(
|
||||
(route) => route.settings.name == Routes.authLogin);
|
||||
}
|
||||
|
Reference in New Issue
Block a user