Skip to content

Commit 72d074c

Browse files
committed
style: format
1 parent 3dfc2ec commit 72d074c

39 files changed

+297
-331
lines changed

lib/account/bloc/account_bloc.dart

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
153153
_logger.severe(
154154
'Failed to create default preferences with HtHttpException: $e',
155155
);
156-
emit(
157-
state.copyWith(
158-
status: AccountStatus.failure,
159-
error: e,
160-
),
161-
);
156+
emit(state.copyWith(status: AccountStatus.failure, error: e));
162157
} catch (e, st) {
163158
_logger.severe(
164159
'Failed to create default preferences with unexpected error: $e',
@@ -178,9 +173,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
178173
_logger.severe(
179174
'AccountLoadUserPreferences failed with HtHttpException: $e',
180175
);
181-
emit(
182-
state.copyWith(status: AccountStatus.failure, error: e),
183-
);
176+
emit(state.copyWith(status: AccountStatus.failure, error: e));
184177
} catch (e, st) {
185178
_logger.severe(
186179
'AccountLoadUserPreferences failed with unexpected error: $e',
@@ -190,9 +183,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
190183
emit(
191184
state.copyWith(
192185
status: AccountStatus.failure,
193-
error: OperationFailedException(
194-
'An unexpected error occurred: $e',
195-
),
186+
error: OperationFailedException('An unexpected error occurred: $e'),
196187
),
197188
);
198189
}
@@ -240,9 +231,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
240231
_logger.severe(
241232
'AccountSaveHeadlineToggled failed with HtHttpException: $e',
242233
);
243-
emit(
244-
state.copyWith(status: AccountStatus.failure, error: e),
245-
);
234+
emit(state.copyWith(status: AccountStatus.failure, error: e));
246235
} catch (e, st) {
247236
_logger.severe(
248237
'AccountSaveHeadlineToggled failed with unexpected error: $e',
@@ -275,7 +264,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
275264

276265
updatedFollowedTopics = isCurrentlyFollowed
277266
? (List.from(currentPrefs.followedTopics)
278-
..removeWhere((t) => t.id == event.topic.id))
267+
..removeWhere((t) => t.id == event.topic.id))
279268
: (List.from(currentPrefs.followedTopics)..add(event.topic));
280269

281270
final updatedPrefs = currentPrefs.copyWith(
@@ -299,9 +288,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
299288
_logger.severe(
300289
'AccountFollowTopicToggled failed with HtHttpException: $e',
301290
);
302-
emit(
303-
state.copyWith(status: AccountStatus.failure, error: e),
304-
);
291+
emit(state.copyWith(status: AccountStatus.failure, error: e));
305292
} catch (e, st) {
306293
_logger.severe(
307294
'AccountFollowTopicToggled failed with unexpected error: $e',
@@ -361,9 +348,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
361348
_logger.severe(
362349
'AccountFollowSourceToggled failed with HtHttpException: $e',
363350
);
364-
emit(
365-
state.copyWith(status: AccountStatus.failure, error: e),
366-
);
351+
emit(state.copyWith(status: AccountStatus.failure, error: e));
367352
} catch (e, st) {
368353
_logger.severe(
369354
'AccountFollowSourceToggled failed with unexpected error: $e',
@@ -411,9 +396,7 @@ class AccountBloc extends Bloc<AccountEvent, AccountState> {
411396
_logger.severe(
412397
'AccountClearUserPreferences failed with HtHttpException: $e',
413398
);
414-
emit(
415-
state.copyWith(status: AccountStatus.failure, error: e),
416-
);
399+
emit(state.copyWith(status: AccountStatus.failure, error: e));
417400
} catch (e, st) {
418401
_logger.severe(
419402
'AccountClearUserPreferences failed with unexpected error: $e',

lib/account/bloc/available_topics_bloc.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ part 'available_topics_state.dart';
1111
class AvailableTopicsBloc
1212
extends Bloc<AvailableTopicsEvent, AvailableTopicsState> {
1313
AvailableTopicsBloc({required HtDataRepository<Topic> topicsRepository})
14-
: _topicsRepository = topicsRepository,
15-
super(const AvailableTopicsState()) {
14+
: _topicsRepository = topicsRepository,
15+
super(const AvailableTopicsState()) {
1616
on<FetchAvailableTopics>(_onFetchAvailableTopics);
1717
}
1818

@@ -38,10 +38,7 @@ class AvailableTopicsBloc
3838
);
3939
} on HtHttpException catch (e) {
4040
emit(
41-
state.copyWith(
42-
status: AvailableTopicsStatus.failure,
43-
error: e.message,
44-
),
41+
state.copyWith(status: AvailableTopicsStatus.failure, error: e.message),
4542
);
4643
} catch (e) {
4744
emit(

lib/account/bloc/available_topics_state.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,5 @@ class AvailableTopicsState extends Equatable {
2727
}
2828

2929
@override
30-
List<Object?> get props => [
31-
status,
32-
availableTopics,
33-
error,
34-
];
30+
List<Object?> get props => [status, availableTopics, error];
3531
}

lib/account/view/manage_followed_items/sources/add_source_to_follow_page.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class AddSourceToFollowPage extends StatelessWidget {
3434
exception: OperationFailedException(
3535
sourcesState.error ?? l10n.sourceFilterError,
3636
),
37-
onRetry: () => context
38-
.read<AvailableSourcesBloc>()
39-
.add(const FetchAvailableSources()),
37+
onRetry: () => context.read<AvailableSourcesBloc>().add(
38+
const FetchAvailableSources(),
39+
),
4040
);
4141
}
4242
if (sourcesState.availableSources.isEmpty) {
@@ -81,8 +81,8 @@ class AddSourceToFollowPage extends StatelessWidget {
8181
: l10n.followSourceTooltip(source.name),
8282
onPressed: () {
8383
context.read<AccountBloc>().add(
84-
AccountFollowSourceToggled(source: source),
85-
);
84+
AccountFollowSourceToggled(source: source),
85+
);
8686
},
8787
),
8888
),

lib/account/view/manage_followed_items/sources/followed_sources_list_page.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ class FollowedSourcesListPage extends StatelessWidget {
4848
if (state.status == AccountStatus.failure &&
4949
state.preferences == null) {
5050
return FailureStateWidget(
51-
exception: state.error ??
51+
exception:
52+
state.error ??
5253
OperationFailedException(l10n.followedSourcesErrorHeadline),
5354
onRetry: () {
5455
if (state.user?.id != null) {
55-
context
56-
.read<AccountBloc>()
57-
.add(AccountLoadUserPreferences(userId: state.user!.id));
56+
context.read<AccountBloc>().add(
57+
AccountLoadUserPreferences(userId: state.user!.id),
58+
);
5859
}
5960
},
6061
);
@@ -87,9 +88,9 @@ class FollowedSourcesListPage extends StatelessWidget {
8788
),
8889
tooltip: l10n.unfollowSourceTooltip(source.name),
8990
onPressed: () {
90-
context
91-
.read<AccountBloc>()
92-
.add(AccountFollowSourceToggled(source: source));
91+
context.read<AccountBloc>().add(
92+
AccountFollowSourceToggled(source: source),
93+
);
9394
},
9495
),
9596
onTap: () {

lib/account/view/manage_followed_items/topics/add_topic_to_follow_page.dart

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ class AddTopicToFollowPage extends StatelessWidget {
4242
exception: OperationFailedException(
4343
topicsState.error ?? l10n.topicFilterError,
4444
),
45-
onRetry: () => context
46-
.read<AvailableTopicsBloc>()
47-
.add(const FetchAvailableTopics()),
45+
onRetry: () => context.read<AvailableTopicsBloc>().add(
46+
const FetchAvailableTopics(),
47+
),
4848
);
4949
}
5050
if (topicsState.availableTopics.isEmpty) {
@@ -102,29 +102,30 @@ class AddTopicToFollowPage extends StatelessWidget {
102102
fit: BoxFit.contain,
103103
errorBuilder:
104104
(context, error, stackTrace) => Icon(
105-
Icons.topic_outlined,
106-
color: colorScheme.onSurfaceVariant,
107-
size: AppSpacing.lg,
108-
),
105+
Icons.topic_outlined,
106+
color: colorScheme.onSurfaceVariant,
107+
size: AppSpacing.lg,
108+
),
109109
loadingBuilder:
110110
(context, child, loadingProgress) {
111-
if (loadingProgress == null) {
112-
return child;
113-
}
114-
return Center(
115-
child: CircularProgressIndicator(
116-
strokeWidth: 2,
117-
value: loadingProgress
118-
.expectedTotalBytes !=
119-
null
120-
? loadingProgress
121-
.cumulativeBytesLoaded /
111+
if (loadingProgress == null) {
112+
return child;
113+
}
114+
return Center(
115+
child: CircularProgressIndicator(
116+
strokeWidth: 2,
117+
value:
122118
loadingProgress
123-
.expectedTotalBytes!
124-
: null,
125-
),
126-
);
127-
},
119+
.expectedTotalBytes !=
120+
null
121+
? loadingProgress
122+
.cumulativeBytesLoaded /
123+
loadingProgress
124+
.expectedTotalBytes!
125+
: null,
126+
),
127+
);
128+
},
128129
),
129130
)
130131
: Icon(
@@ -133,10 +134,7 @@ class AddTopicToFollowPage extends StatelessWidget {
133134
size: AppSpacing.lg,
134135
),
135136
),
136-
title: Text(
137-
topic.name,
138-
style: textTheme.titleMedium,
139-
),
137+
title: Text(topic.name, style: textTheme.titleMedium),
140138
trailing: IconButton(
141139
icon: isFollowed
142140
? Icon(
@@ -152,8 +150,8 @@ class AddTopicToFollowPage extends StatelessWidget {
152150
: l10n.followTopicTooltip(topic.name),
153151
onPressed: () {
154152
context.read<AccountBloc>().add(
155-
AccountFollowTopicToggled(topic: topic),
156-
);
153+
AccountFollowTopicToggled(topic: topic),
154+
);
157155
},
158156
),
159157
contentPadding: const EdgeInsets.symmetric(

lib/account/view/manage_followed_items/topics/followed_topics_list_page.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ class FollowedTopicsListPage extends StatelessWidget {
4848
if (state.status == AccountStatus.failure &&
4949
state.preferences == null) {
5050
return FailureStateWidget(
51-
exception: state.error ??
51+
exception:
52+
state.error ??
5253
OperationFailedException(l10n.followedTopicsErrorHeadline),
5354
onRetry: () {
5455
if (state.user?.id != null) {
55-
context
56-
.read<AccountBloc>()
57-
.add(AccountLoadUserPreferences(userId: state.user!.id));
56+
context.read<AccountBloc>().add(
57+
AccountLoadUserPreferences(userId: state.user!.id),
58+
);
5859
}
5960
},
6061
);
@@ -95,9 +96,9 @@ class FollowedTopicsListPage extends StatelessWidget {
9596
),
9697
tooltip: l10n.unfollowTopicTooltip(topic.name),
9798
onPressed: () {
98-
context
99-
.read<AccountBloc>()
100-
.add(AccountFollowTopicToggled(topic: topic));
99+
context.read<AccountBloc>().add(
100+
AccountFollowTopicToggled(topic: topic),
101+
);
101102
},
102103
),
103104
onTap: () {

lib/account/view/saved_headlines_page.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ class SavedHeadlinesPage extends StatelessWidget {
4848
if (state.status == AccountStatus.failure &&
4949
state.preferences == null) {
5050
return FailureStateWidget(
51-
exception: state.error ??
51+
exception:
52+
state.error ??
5253
OperationFailedException(l10n.savedHeadlinesErrorHeadline),
5354
onRetry: () {
5455
if (state.user?.id != null) {
5556
context.read<AccountBloc>().add(
56-
AccountLoadUserPreferences(userId: state.user!.id),
57-
);
57+
AccountLoadUserPreferences(userId: state.user!.id),
58+
);
5859
}
5960
},
6061
);

lib/app/bloc/app_bloc.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,7 @@ class AppBloc extends Bloc<AppEvent, AppState> {
518518
}
519519
}
520520

521-
Future<void> _onAppOpened(
522-
AppOpened event,
523-
Emitter<AppState> emit,
524-
) async {
521+
Future<void> _onAppOpened(AppOpened event, Emitter<AppState> emit) async {
525522
if (state.appConfig == null) {
526523
return;
527524
}

lib/app/services/demo_data_migration_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ class DemoDataMigrationService {
139139
);
140140
}
141141
}
142-
}
142+
}

0 commit comments

Comments
 (0)