From ea078eaa028871836c0c035ef9bfd2144dc2021f Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Fri, 13 Mar 2026 17:15:44 -0400 Subject: [PATCH] refactor: Rearrange MultiBlocProvider and Scaffold structure in ClockInPage for improved readability --- .../src/presentation/pages/clock_in_page.dart | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/apps/mobile/packages/features/staff/clock_in/lib/src/presentation/pages/clock_in_page.dart b/apps/mobile/packages/features/staff/clock_in/lib/src/presentation/pages/clock_in_page.dart index 250494b0..f3b36fe2 100644 --- a/apps/mobile/packages/features/staff/clock_in/lib/src/presentation/pages/clock_in_page.dart +++ b/apps/mobile/packages/features/staff/clock_in/lib/src/presentation/pages/clock_in_page.dart @@ -25,29 +25,25 @@ class ClockInPage extends StatelessWidget { context, ).staff.clock_in; - return MultiBlocProvider( - providers: >[ - BlocProvider.value( - value: Modular.get(), - ), - BlocProvider.value( - value: Modular.get(), - ), - ], - child: BlocListener( - listenWhen: (ClockInState previous, ClockInState current) => - current.status == ClockInStatus.failure && - current.errorMessage != null, - listener: (BuildContext context, ClockInState state) { - UiSnackbar.show( - context, - message: translateErrorKey(state.errorMessage!), - type: UiSnackbarType.error, - ); - }, - child: Scaffold( - appBar: UiAppBar(title: i18n.title, showBackButton: false), - body: BlocBuilder( + return Scaffold( + appBar: UiAppBar(title: i18n.title, showBackButton: false), + body: MultiBlocProvider( + providers: >[ + BlocProvider.value(value: Modular.get()), + BlocProvider.value(value: Modular.get()), + ], + child: BlocListener( + listenWhen: (ClockInState previous, ClockInState current) => + current.status == ClockInStatus.failure && + current.errorMessage != null, + listener: (BuildContext context, ClockInState state) { + UiSnackbar.show( + context, + message: translateErrorKey(state.errorMessage!), + type: UiSnackbarType.error, + ); + }, + child: BlocBuilder( buildWhen: (ClockInState previous, ClockInState current) => previous.status != current.status || previous.todayShifts != current.todayShifts,