Skip to content

Commit b8775a8

Browse files
authored
Merge pull request #63 from flutter-news-app-full-source-code/fix-app-configuration-ui
Fix app configuration UI
2 parents 81f0aca + 7645a46 commit b8775a8

23 files changed

+791
-179
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +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,
88-
),
89-
language: languagesFixturesData.firstWhere(
90-
(l) => l.code == 'en',
91-
orElse: () => throw StateError(
92-
'Default language "en" not found in language fixtures.',
85+
fontFamily: 'SystemDefault',
86+
textScaleFactor: AppTextScaleFactor.medium,
87+
fontWeight: AppFontWeight.regular,
9388
),
94-
),
95-
feedPreferences: const FeedDisplayPreferences(
96-
headlineDensity: HeadlineDensity.standard,
89+
language: languagesFixturesData.firstWhere(
90+
(l) => l.code == 'en',
91+
orElse: () => throw StateError(
92+
'Default language "en" not found in language fixtures.',
93+
),
94+
),
95+
feedPreferences: const FeedDisplayPreferences(
96+
headlineDensity: HeadlineDensity.standard,
9797
headlineImageStyle: HeadlineImageStyle.largeThumbnail,
9898
showSourceInHeadlineFeed: true,
9999
showPublishDateInHeadlineFeed: true,

lib/app/view/app.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'package:flutter_news_app_web_dashboard_full_source_code/content_manageme
1616
import 'package:flutter_news_app_web_dashboard_full_source_code/dashboard/bloc/dashboard_bloc.dart';
1717
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/app_localizations.dart';
1818
import 'package:flutter_news_app_web_dashboard_full_source_code/router/router.dart';
19-
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/services/throttled_fetching_service.dart';
19+
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/shared.dart';
2020
import 'package:go_router/go_router.dart';
2121
import 'package:kv_storage_service/kv_storage_service.dart';
2222
import 'package:logging/logging.dart';
@@ -80,7 +80,9 @@ class App extends StatelessWidget {
8080
RepositoryProvider.value(value: _countriesRepository),
8181
RepositoryProvider.value(value: _languagesRepository),
8282
RepositoryProvider.value(value: _kvStorageService),
83-
RepositoryProvider(create: (context) => const ThrottledFetchingService()),
83+
RepositoryProvider(
84+
create: (context) => const ThrottledFetchingService(),
85+
),
8486
],
8587
child: MultiBlocProvider(
8688
providers: [
@@ -204,7 +206,6 @@ class _AppViewState extends State<_AppView> {
204206
fontFamily: fontFamily,
205207
);
206208

207-
const double kMaxAppWidth = 1000; // Local constant for max width
208209
return Center(
209210
child: Card(
210211
margin: EdgeInsets.zero, // Remove default card margin
@@ -215,7 +216,9 @@ class _AppViewState extends State<_AppView> {
215216
), // Match cardRadius from theme
216217
),
217218
child: ConstrainedBox(
218-
constraints: const BoxConstraints(maxWidth: kMaxAppWidth),
219+
constraints: const BoxConstraints(
220+
maxWidth: AppConstants.kMaxAppWidth,
221+
),
219222
child: MaterialApp.router(
220223
debugShowCheckedModeBanner: false,
221224
routerConfig: _router,

0 commit comments

Comments
 (0)