Skip to content

Commit 5106cf1

Browse files
committed
style: misc format
1 parent 06dc69b commit 5106cf1

File tree

11 files changed

+90
-74
lines changed

11 files changed

+90
-74
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: [

lib/app_configuration/view/app_configuration_page.dart

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,15 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
368368
RemoteConfig remoteConfig,
369369
) {
370370
final l10n = AppLocalizationsX(context).l10n;
371-
371+
372372
return Column(
373373
crossAxisAlignment: CrossAxisAlignment.start,
374374
children: [
375375
Text(
376376
l10n.feedDecoratorsDescription,
377377
style: Theme.of(context).textTheme.bodySmall?.copyWith(
378-
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
379-
),
378+
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
379+
),
380380
),
381381
const SizedBox(height: AppSpacing.lg),
382382
for (final decoratorType in FeedDecoratorType.values)
@@ -393,8 +393,8 @@ class _AppConfigurationPageState extends State<AppConfigurationPage>
393393
remoteConfig: remoteConfig,
394394
onConfigChanged: (newConfig) {
395395
context.read<AppConfigurationBloc>().add(
396-
AppConfigurationFieldChanged(remoteConfig: newConfig),
397-
);
396+
AppConfigurationFieldChanged(remoteConfig: newConfig),
397+
);
398398
},
399399
buildIntField: _buildIntField,
400400
),
@@ -955,7 +955,8 @@ class _FeedDecoratorForm extends StatefulWidget {
955955
required int value,
956956
required ValueChanged<int> onChanged,
957957
TextEditingController? controller,
958-
}) buildIntField;
958+
})
959+
buildIntField;
959960

960961
@override
961962
State<_FeedDecoratorForm> createState() => _FeedDecoratorFormState();
@@ -990,7 +991,8 @@ class _FeedDecoratorFormState extends State<_FeedDecoratorForm> {
990991
_roleControllers = {
991992
for (final role in AppUserRole.values)
992993
role: TextEditingController(
993-
text: decoratorConfig.visibleTo[role]?.daysBetweenViews.toString() ??
994+
text:
995+
decoratorConfig.visibleTo[role]?.daysBetweenViews.toString() ??
994996
'',
995997
),
996998
};
@@ -1031,29 +1033,29 @@ class _FeedDecoratorFormState extends State<_FeedDecoratorForm> {
10311033
final newDecoratorConfig = decoratorConfig.copyWith(enabled: value);
10321034
final newFeedDecoratorConfig =
10331035
Map<FeedDecoratorType, FeedDecoratorConfig>.from(
1034-
widget.remoteConfig.feedDecoratorConfig,
1035-
)..[widget.decoratorType] = newDecoratorConfig;
1036+
widget.remoteConfig.feedDecoratorConfig,
1037+
)..[widget.decoratorType] = newDecoratorConfig;
10361038
widget.onConfigChanged(
10371039
widget.remoteConfig.copyWith(
10381040
feedDecoratorConfig: newFeedDecoratorConfig,
10391041
),
10401042
);
10411043
},
10421044
),
1043-
if (decoratorConfig.category ==
1044-
FeedDecoratorCategory.contentCollection)
1045+
if (decoratorConfig.category == FeedDecoratorCategory.contentCollection)
10451046
widget.buildIntField(
10461047
context,
10471048
label: l10n.itemsToDisplayLabel,
10481049
description: l10n.itemsToDisplayDescription,
10491050
value: decoratorConfig.itemsToDisplay ?? 0,
10501051
onChanged: (value) {
1051-
final newDecoratorConfig =
1052-
decoratorConfig.copyWith(itemsToDisplay: value);
1052+
final newDecoratorConfig = decoratorConfig.copyWith(
1053+
itemsToDisplay: value,
1054+
);
10531055
final newFeedDecoratorConfig =
10541056
Map<FeedDecoratorType, FeedDecoratorConfig>.from(
1055-
widget.remoteConfig.feedDecoratorConfig,
1056-
)..[widget.decoratorType] = newDecoratorConfig;
1057+
widget.remoteConfig.feedDecoratorConfig,
1058+
)..[widget.decoratorType] = newDecoratorConfig;
10571059
widget.onConfigChanged(
10581060
widget.remoteConfig.copyWith(
10591061
feedDecoratorConfig: newFeedDecoratorConfig,
@@ -1074,20 +1076,22 @@ class _FeedDecoratorFormState extends State<_FeedDecoratorForm> {
10741076
onChanged: (value) {
10751077
final newVisibleTo =
10761078
Map<AppUserRole, FeedDecoratorRoleConfig>.from(
1077-
decoratorConfig.visibleTo,
1078-
);
1079+
decoratorConfig.visibleTo,
1080+
);
10791081
if (value == true) {
1080-
newVisibleTo[role] =
1081-
const FeedDecoratorRoleConfig(daysBetweenViews: 7);
1082+
newVisibleTo[role] = const FeedDecoratorRoleConfig(
1083+
daysBetweenViews: 7,
1084+
);
10821085
} else {
10831086
newVisibleTo.remove(role);
10841087
}
1085-
final newDecoratorConfig =
1086-
decoratorConfig.copyWith(visibleTo: newVisibleTo);
1088+
final newDecoratorConfig = decoratorConfig.copyWith(
1089+
visibleTo: newVisibleTo,
1090+
);
10871091
final newFeedDecoratorConfig =
10881092
Map<FeedDecoratorType, FeedDecoratorConfig>.from(
1089-
widget.remoteConfig.feedDecoratorConfig,
1090-
)..[widget.decoratorType] = newDecoratorConfig;
1093+
widget.remoteConfig.feedDecoratorConfig,
1094+
)..[widget.decoratorType] = newDecoratorConfig;
10911095
widget.onConfigChanged(
10921096
widget.remoteConfig.copyWith(
10931097
feedDecoratorConfig: newFeedDecoratorConfig,
@@ -1107,18 +1111,20 @@ class _FeedDecoratorFormState extends State<_FeedDecoratorForm> {
11071111
description: l10n.daysBetweenViewsDescription,
11081112
value: roleConfig.daysBetweenViews,
11091113
onChanged: (value) {
1110-
final newRoleConfig =
1111-
roleConfig.copyWith(daysBetweenViews: value);
1114+
final newRoleConfig = roleConfig.copyWith(
1115+
daysBetweenViews: value,
1116+
);
11121117
final newVisibleTo =
11131118
Map<AppUserRole, FeedDecoratorRoleConfig>.from(
1114-
decoratorConfig.visibleTo,
1115-
)..[role] = newRoleConfig;
1116-
final newDecoratorConfig =
1117-
decoratorConfig.copyWith(visibleTo: newVisibleTo);
1119+
decoratorConfig.visibleTo,
1120+
)..[role] = newRoleConfig;
1121+
final newDecoratorConfig = decoratorConfig.copyWith(
1122+
visibleTo: newVisibleTo,
1123+
);
11181124
final newFeedDecoratorConfig =
11191125
Map<FeedDecoratorType, FeedDecoratorConfig>.from(
1120-
widget.remoteConfig.feedDecoratorConfig,
1121-
)..[widget.decoratorType] = newDecoratorConfig;
1126+
widget.remoteConfig.feedDecoratorConfig,
1127+
)..[widget.decoratorType] = newDecoratorConfig;
11221128
widget.onConfigChanged(
11231129
widget.remoteConfig.copyWith(
11241130
feedDecoratorConfig: newFeedDecoratorConfig,

lib/content_management/bloc/archived_headlines/archived_headlines_bloc.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,15 @@ class ArchivedHeadlinesBloc
169169
final updatedHeadlines = List<Headline>.from(state.headlines)
170170
..insert(
171171
state.headlines.indexWhere(
172-
(h) =>
173-
h.updatedAt.isBefore(state.lastDeletedHeadline!.updatedAt),
174-
) !=
175-
-1
172+
(h) => h.updatedAt.isBefore(
173+
state.lastDeletedHeadline!.updatedAt,
174+
),
175+
) !=
176+
-1
176177
? state.headlines.indexWhere(
177-
(h) =>
178-
h.updatedAt.isBefore(state.lastDeletedHeadline!.updatedAt),
178+
(h) => h.updatedAt.isBefore(
179+
state.lastDeletedHeadline!.updatedAt,
180+
),
179181
)
180182
: state.headlines.length,
181183
state.lastDeletedHeadline!,

lib/content_management/bloc/archived_headlines/archived_headlines_state.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class ArchivedHeadlinesState extends Equatable {
5050

5151
@override
5252
List<Object?> get props => [
53-
status,
54-
headlines,
55-
cursor,
56-
hasMore,
57-
exception,
58-
restoredHeadline,
59-
lastDeletedHeadline,
60-
];
53+
status,
54+
headlines,
55+
cursor,
56+
hasMore,
57+
exception,
58+
restoredHeadline,
59+
lastDeletedHeadline,
60+
];
6161
}

lib/content_management/bloc/content_management_bloc.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class ContentManagementBloc
2828
required DataRepository<Country> countriesRepository,
2929
required DataRepository<Language> languagesRepository,
3030
required ThrottledFetchingService fetchingService,
31-
}) : _headlinesRepository = headlinesRepository,
32-
_topicsRepository = topicsRepository,
33-
_sourcesRepository = sourcesRepository,
34-
_countriesRepository = countriesRepository,
35-
_languagesRepository = languagesRepository,
36-
_fetchingService = fetchingService,
37-
super(const ContentManagementState()) {
31+
}) : _headlinesRepository = headlinesRepository,
32+
_topicsRepository = topicsRepository,
33+
_sourcesRepository = sourcesRepository,
34+
_countriesRepository = countriesRepository,
35+
_languagesRepository = languagesRepository,
36+
_fetchingService = fetchingService,
37+
super(const ContentManagementState()) {
3838
on<SharedDataRequested>(_onSharedDataRequested);
3939
on<ContentManagementTabChanged>(_onContentManagementTabChanged);
4040
on<LoadHeadlinesRequested>(_onLoadHeadlinesRequested);

lib/content_management/bloc/create_source/create_source_bloc.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
136136
CreateSourceDataUpdated event,
137137
Emitter<CreateSourceState> emit,
138138
) {
139-
emit(state.copyWith(countries: event.countries, languages: event.languages));
139+
emit(
140+
state.copyWith(countries: event.countries, languages: event.languages),
141+
);
140142
}
141143
}

lib/content_management/bloc/edit_source/edit_source_bloc.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
201201
EditSourceDataUpdated event,
202202
Emitter<EditSourceState> emit,
203203
) {
204-
emit(state.copyWith(countries: event.countries, languages: event.languages));
204+
emit(
205+
state.copyWith(countries: event.countries, languages: event.languages),
206+
);
205207
}
206208
}

lib/content_management/view/archived_headlines_page.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ class _ArchivedHeadlinesView extends StatelessWidget {
4848
);
4949
}
5050
if (state.lastDeletedHeadline != null) {
51-
final truncatedTitle =
52-
state.lastDeletedHeadline!.title.truncate(30);
51+
final truncatedTitle = state.lastDeletedHeadline!.title.truncate(
52+
30,
53+
);
5354
ScaffoldMessenger.of(context)
5455
..hideCurrentSnackBar()
5556
..showSnackBar(
@@ -60,9 +61,9 @@ class _ArchivedHeadlinesView extends StatelessWidget {
6061
action: SnackBarAction(
6162
label: l10n.undo,
6263
onPressed: () {
63-
context
64-
.read<ArchivedHeadlinesBloc>()
65-
.add(const UndoDeleteHeadlineRequested());
64+
context.read<ArchivedHeadlinesBloc>().add(
65+
const UndoDeleteHeadlineRequested(),
66+
);
6667
},
6768
),
6869
),

lib/settings/view/settings_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ class _LanguageSelectionList extends StatelessWidget {
436436
onTap: () {
437437
if (!isSelected) {
438438
context.read<SettingsBloc>().add(
439-
SettingsLanguageChanged(language),
440-
);
439+
SettingsLanguageChanged(language),
440+
);
441441
}
442442
},
443443
);

0 commit comments

Comments
 (0)