Skip to content

Commit 81f0aca

Browse files
authored
Merge pull request #62 from flutter-news-app-full-source-code/sync-the-dashbaord-with-the-core-models-change
Sync the dashbaord with the core models change
2 parents 73ecda8 + 338e3cb commit 81f0aca

File tree

12 files changed

+441
-244
lines changed

12 files changed

+441
-244
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,18 @@ class AppBloc extends Bloc<AppEvent, AppState> {
8282
displaySettings: const DisplaySettings(
8383
baseTheme: AppBaseTheme.system,
8484
accentTheme: AppAccentTheme.defaultBlue,
85-
fontFamily: 'SystemDefault',
86-
textScaleFactor: AppTextScaleFactor.medium,
87-
fontWeight: AppFontWeight.regular,
85+
fontFamily: 'SystemDefault',
86+
textScaleFactor: AppTextScaleFactor.medium,
87+
fontWeight: AppFontWeight.regular,
88+
),
89+
language: languagesFixturesData.firstWhere(
90+
(l) => l.code == 'en',
91+
orElse: () => throw StateError(
92+
'Default language "en" not found in language fixtures.',
8893
),
89-
language: 'en',
90-
feedPreferences: const FeedDisplayPreferences(
91-
headlineDensity: HeadlineDensity.standard,
94+
),
95+
feedPreferences: const FeedDisplayPreferences(
96+
headlineDensity: HeadlineDensity.standard,
9297
headlineImageStyle: HeadlineImageStyle.largeThumbnail,
9398
showSourceInHeadlineFeed: true,
9499
showPublishDateInHeadlineFeed: true,

lib/app/view/app.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class _AppViewState extends State<_AppView> {
233233
AppBaseTheme.dark => ThemeMode.dark,
234234
_ => ThemeMode.system,
235235
},
236-
locale: language != null ? Locale(language) : null,
236+
locale: language != null ? Locale(language.code) : null,
237237
),
238238
),
239239
),

0 commit comments

Comments
 (0)