@@ -20,8 +20,8 @@ class SettingsPage extends StatelessWidget {
2020 Widget build (BuildContext context) {
2121 return BlocProvider (
2222 create: (context) => SettingsBloc (
23- userAppSettingsRepository:
24- context .read <HtDataRepository <UserAppSettings >>(),
23+ userAppSettingsRepository: context
24+ .read <HtDataRepository <UserAppSettings >>(),
2525 )..add (SettingsLoaded (userId: context.read <AppBloc >().state.user? .id)),
2626 child: const _SettingsView (),
2727 );
@@ -40,7 +40,8 @@ class _SettingsView extends StatelessWidget {
4040 ),
4141 body: BlocConsumer <SettingsBloc , SettingsState >(
4242 listenWhen: (previous, current) =>
43- current is SettingsUpdateSuccess || current is SettingsUpdateFailure ,
43+ current is SettingsUpdateSuccess ||
44+ current is SettingsUpdateFailure ,
4445 listener: (context, state) {
4546 if (state is SettingsUpdateSuccess ) {
4647 ScaffoldMessenger .of (context)
@@ -52,23 +53,23 @@ class _SettingsView extends StatelessWidget {
5253 );
5354 // Optionally, trigger AppBloc to reload settings if it caches them
5455 context.read <AppBloc >().add (
55- AppUserChanged (
56- context.read <AppBloc >().state.user? .copyWith (
57- // This is a simplified way to trigger AppBloc update.
58- // A more robust solution might involve AppBloc listening
59- // to SettingsBloc directly or a dedicated event.
60- // For now, we'll rely on the AppBloc's authStateChanges
61- // listener to eventually pick up the change if the
62- // repository emits it, or a manual refresh.
63- // For immediate UI update, we might need to pass the
64- // updated settings to AppBloc.
65- // For this task, we'll assume AppBloc will react
66- // to the repository change or a full app restart.
67- // A better approach would be to have AppBloc listen
68- // to UserAppSettings changes from its repository.
69- ),
70- ),
71- );
56+ AppUserChanged (
57+ context.read <AppBloc >().state.user? .copyWith (
58+ // This is a simplified way to trigger AppBloc update.
59+ // A more robust solution might involve AppBloc listening
60+ // to SettingsBloc directly or a dedicated event.
61+ // For now, we'll rely on the AppBloc's authStateChanges
62+ // listener to eventually pick up the change if the
63+ // repository emits it, or a manual refresh.
64+ // For immediate UI update, we might need to pass the
65+ // updated settings to AppBloc.
66+ // For this task, we'll assume AppBloc will react
67+ // to the repository change or a full app restart.
68+ // A better approach would be to have AppBloc listen
69+ // to UserAppSettings changes from its repository.
70+ ),
71+ ),
72+ );
7273 } else if (state is SettingsUpdateFailure ) {
7374 ScaffoldMessenger .of (context)
7475 ..hideCurrentSnackBar ()
@@ -93,10 +94,10 @@ class _SettingsView extends StatelessWidget {
9394 message: l10n.failedToLoadSettingsMessage (state.errorMessage),
9495 onRetry: () {
9596 context.read <SettingsBloc >().add (
96- SettingsLoaded (
97- userId: context.read <AppBloc >().state.user? .id,
98- ),
99- );
97+ SettingsLoaded (
98+ userId: context.read <AppBloc >().state.user? .id,
99+ ),
100+ );
100101 },
101102 );
102103 } else if (state is SettingsLoadSuccess ) {
@@ -132,9 +133,9 @@ class _SettingsView extends StatelessWidget {
132133 value: userAppSettings.displaySettings.baseTheme,
133134 onChanged: (value) {
134135 if (value != null ) {
135- context
136- . read < SettingsBloc >()
137- . add ( SettingsBaseThemeChanged (value) );
136+ context. read < SettingsBloc >(). add (
137+ SettingsBaseThemeChanged (value),
138+ );
138139 }
139140 },
140141 items: AppBaseTheme .values
@@ -158,9 +159,9 @@ class _SettingsView extends StatelessWidget {
158159 value: userAppSettings.displaySettings.accentTheme,
159160 onChanged: (value) {
160161 if (value != null ) {
161- context
162- . read < SettingsBloc >()
163- . add ( SettingsAccentThemeChanged (value) );
162+ context. read < SettingsBloc >(). add (
163+ SettingsAccentThemeChanged (value),
164+ );
164165 }
165166 },
166167 items: AppAccentTheme .values
@@ -184,9 +185,9 @@ class _SettingsView extends StatelessWidget {
184185 value: userAppSettings.displaySettings.fontFamily,
185186 onChanged: (value) {
186187 if (value != null ) {
187- context
188- . read < SettingsBloc >()
189- . add ( SettingsFontFamilyChanged (value) );
188+ context. read < SettingsBloc >(). add (
189+ SettingsFontFamilyChanged (value),
190+ );
190191 }
191192 },
192193 items: _supportedFontFamilies
@@ -210,9 +211,9 @@ class _SettingsView extends StatelessWidget {
210211 value: userAppSettings.displaySettings.textScaleFactor,
211212 onChanged: (value) {
212213 if (value != null ) {
213- context
214- . read < SettingsBloc >()
215- . add ( SettingsTextScaleFactorChanged (value) );
214+ context. read < SettingsBloc >(). add (
215+ SettingsTextScaleFactorChanged (value),
216+ );
216217 }
217218 },
218219 items: AppTextScaleFactor .values
@@ -236,9 +237,9 @@ class _SettingsView extends StatelessWidget {
236237 value: userAppSettings.displaySettings.fontWeight,
237238 onChanged: (value) {
238239 if (value != null ) {
239- context
240- . read < SettingsBloc >()
241- . add ( SettingsFontWeightChanged (value) );
240+ context. read < SettingsBloc >(). add (
241+ SettingsFontWeightChanged (value),
242+ );
242243 }
243244 },
244245 items: AppFontWeight .values
@@ -262,9 +263,9 @@ class _SettingsView extends StatelessWidget {
262263 value: userAppSettings.language,
263264 onChanged: (value) {
264265 if (value != null ) {
265- context
266- . read < SettingsBloc >()
267- . add ( SettingsLanguageChanged (value) );
266+ context. read < SettingsBloc >(). add (
267+ SettingsLanguageChanged (value),
268+ );
268269 }
269270 },
270271 items: _supportedLanguages
@@ -299,8 +300,8 @@ class _SettingsView extends StatelessWidget {
299300 Text (
300301 description,
301302 style: Theme .of (context).textTheme.bodySmall? .copyWith (
302- color: Theme .of (context).colorScheme.onSurfaceVariant,
303- ),
303+ color: Theme .of (context).colorScheme.onSurfaceVariant,
304+ ),
304305 ),
305306 const SizedBox (height: AppSpacing .sm),
306307 Align (
0 commit comments