refactor: Rearrange MultiBlocProvider and Scaffold structure in ClockInPage for improved readability

This commit is contained in:
Achintha Isuru
2026-03-13 17:15:44 -04:00
parent a85cd36975
commit ea078eaa02

View File

@@ -25,14 +25,12 @@ class ClockInPage extends StatelessWidget {
context, context,
).staff.clock_in; ).staff.clock_in;
return MultiBlocProvider( return Scaffold(
appBar: UiAppBar(title: i18n.title, showBackButton: false),
body: MultiBlocProvider(
providers: <BlocProvider<dynamic>>[ providers: <BlocProvider<dynamic>>[
BlocProvider<ClockInBloc>.value( BlocProvider<ClockInBloc>.value(value: Modular.get<ClockInBloc>()),
value: Modular.get<ClockInBloc>(), BlocProvider<GeofenceBloc>.value(value: Modular.get<GeofenceBloc>()),
),
BlocProvider<GeofenceBloc>.value(
value: Modular.get<GeofenceBloc>(),
),
], ],
child: BlocListener<ClockInBloc, ClockInState>( child: BlocListener<ClockInBloc, ClockInState>(
listenWhen: (ClockInState previous, ClockInState current) => listenWhen: (ClockInState previous, ClockInState current) =>
@@ -45,9 +43,7 @@ class ClockInPage extends StatelessWidget {
type: UiSnackbarType.error, type: UiSnackbarType.error,
); );
}, },
child: Scaffold( child: BlocBuilder<ClockInBloc, ClockInState>(
appBar: UiAppBar(title: i18n.title, showBackButton: false),
body: BlocBuilder<ClockInBloc, ClockInState>(
buildWhen: (ClockInState previous, ClockInState current) => buildWhen: (ClockInState previous, ClockInState current) =>
previous.status != current.status || previous.status != current.status ||
previous.todayShifts != current.todayShifts, previous.todayShifts != current.todayShifts,