Skip to content

Commit 1777c90

Browse files
committed
style: format misc
1 parent 56a41d0 commit 1777c90

23 files changed

+505
-446
lines changed

lib/account/view/manage_followed_items/countries/add_country_to_follow_page.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AddCountryToFollowPage extends StatelessWidget {
6060
return BlocBuilder<AppBloc, AppState>(
6161
buildWhen: (previous, current) =>
6262
previous.userContentPreferences?.followedCountries !=
63-
current.userContentPreferences?.followedCountries,
63+
current.userContentPreferences?.followedCountries,
6464
builder: (context, appState) {
6565
final userContentPreferences = appState.userContentPreferences;
6666
final followedCountries =
@@ -152,25 +152,27 @@ class AddCountryToFollowPage extends StatelessWidget {
152152
onPressed: () {
153153
if (userContentPreferences == null) return;
154154

155-
final updatedFollowedCountries =
156-
List<Country>.from(followedCountries);
155+
final updatedFollowedCountries = List<Country>.from(
156+
followedCountries,
157+
);
157158
if (isFollowed) {
158-
updatedFollowedCountries
159-
.removeWhere((c) => c.id == country.id);
159+
updatedFollowedCountries.removeWhere(
160+
(c) => c.id == country.id,
161+
);
160162
} else {
161163
updatedFollowedCountries.add(country);
162164
}
163165

164-
final updatedPreferences =
165-
userContentPreferences.copyWith(
166-
followedCountries: updatedFollowedCountries,
167-
);
166+
final updatedPreferences = userContentPreferences
167+
.copyWith(
168+
followedCountries: updatedFollowedCountries,
169+
);
168170

169171
context.read<AppBloc>().add(
170-
AppUserContentPreferencesChanged(
171-
preferences: updatedPreferences,
172-
),
173-
);
172+
AppUserContentPreferencesChanged(
173+
preferences: updatedPreferences,
174+
),
175+
);
174176
},
175177
),
176178
contentPadding: const EdgeInsets.symmetric(

lib/account/view/manage_followed_items/countries/followed_countries_list_page.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ class FollowedCountriesListPage extends StatelessWidget {
5050
return FailureStateWidget(
5151
exception: appState.initialUserPreferencesError!,
5252
onRetry: () {
53-
context.read<AppBloc>().add(
54-
AppStarted(initialUser: user),
55-
);
53+
context.read<AppBloc>().add(AppStarted(initialUser: user));
5654
},
5755
);
5856
}
@@ -89,20 +87,19 @@ class FollowedCountriesListPage extends StatelessWidget {
8987
),
9088
tooltip: l10n.unfollowCountryTooltip(country.name),
9189
onPressed: () {
92-
final updatedFollowedCountries =
93-
List<Country>.from(followedCountries)
94-
..removeWhere((c) => c.id == country.id);
90+
final updatedFollowedCountries = List<Country>.from(
91+
followedCountries,
92+
)..removeWhere((c) => c.id == country.id);
9593

96-
final updatedPreferences =
97-
userContentPreferences.copyWith(
94+
final updatedPreferences = userContentPreferences.copyWith(
9895
followedCountries: updatedFollowedCountries,
9996
);
10097

10198
context.read<AppBloc>().add(
102-
AppUserContentPreferencesChanged(
103-
preferences: updatedPreferences,
104-
),
105-
);
99+
AppUserContentPreferencesChanged(
100+
preferences: updatedPreferences,
101+
),
102+
);
106103
},
107104
),
108105
onTap: () async {

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AddSourceToFollowPage extends StatelessWidget {
5050
return BlocBuilder<AppBloc, AppState>(
5151
buildWhen: (previous, current) =>
5252
previous.userContentPreferences?.followedSources !=
53-
current.userContentPreferences?.followedSources,
53+
current.userContentPreferences?.followedSources,
5454
builder: (context, appState) {
5555
final userContentPreferences = appState.userContentPreferences;
5656
final followedSources =
@@ -82,25 +82,27 @@ class AddSourceToFollowPage extends StatelessWidget {
8282
onPressed: () {
8383
if (userContentPreferences == null) return;
8484

85-
final updatedFollowedSources =
86-
List<Source>.from(followedSources);
85+
final updatedFollowedSources = List<Source>.from(
86+
followedSources,
87+
);
8788
if (isFollowed) {
88-
updatedFollowedSources
89-
.removeWhere((s) => s.id == source.id);
89+
updatedFollowedSources.removeWhere(
90+
(s) => s.id == source.id,
91+
);
9092
} else {
9193
updatedFollowedSources.add(source);
9294
}
9395

94-
final updatedPreferences =
95-
userContentPreferences.copyWith(
96-
followedSources: updatedFollowedSources,
97-
);
96+
final updatedPreferences = userContentPreferences
97+
.copyWith(
98+
followedSources: updatedFollowedSources,
99+
);
98100

99101
context.read<AppBloc>().add(
100-
AppUserContentPreferencesChanged(
101-
preferences: updatedPreferences,
102-
),
103-
);
102+
AppUserContentPreferencesChanged(
103+
preferences: updatedPreferences,
104+
),
105+
);
104106
},
105107
),
106108
),

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ class FollowedSourcesListPage extends StatelessWidget {
5050
return FailureStateWidget(
5151
exception: appState.initialUserPreferencesError!,
5252
onRetry: () {
53-
context.read<AppBloc>().add(
54-
AppStarted(initialUser: user),
55-
);
53+
context.read<AppBloc>().add(AppStarted(initialUser: user));
5654
},
5755
);
5856
}
@@ -86,20 +84,19 @@ class FollowedSourcesListPage extends StatelessWidget {
8684
),
8785
tooltip: l10n.unfollowSourceTooltip(source.name),
8886
onPressed: () {
89-
final updatedFollowedSources =
90-
List<Source>.from(followedSources)
91-
..removeWhere((s) => s.id == source.id);
87+
final updatedFollowedSources = List<Source>.from(
88+
followedSources,
89+
)..removeWhere((s) => s.id == source.id);
9290

93-
final updatedPreferences =
94-
userContentPreferences.copyWith(
91+
final updatedPreferences = userContentPreferences.copyWith(
9592
followedSources: updatedFollowedSources,
9693
);
9794

9895
context.read<AppBloc>().add(
99-
AppUserContentPreferencesChanged(
100-
preferences: updatedPreferences,
101-
),
102-
);
96+
AppUserContentPreferencesChanged(
97+
preferences: updatedPreferences,
98+
),
99+
);
103100
},
104101
),
105102
onTap: () async {

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AddTopicToFollowPage extends StatelessWidget {
6060
return BlocBuilder<AppBloc, AppState>(
6161
buildWhen: (previous, current) =>
6262
previous.userContentPreferences?.followedTopics !=
63-
current.userContentPreferences?.followedTopics,
63+
current.userContentPreferences?.followedTopics,
6464
builder: (context, appState) {
6565
final userContentPreferences = appState.userContentPreferences;
6666
final followedTopics =
@@ -151,25 +151,27 @@ class AddTopicToFollowPage extends StatelessWidget {
151151
onPressed: () {
152152
if (userContentPreferences == null) return;
153153

154-
final updatedFollowedTopics =
155-
List<Topic>.from(followedTopics);
154+
final updatedFollowedTopics = List<Topic>.from(
155+
followedTopics,
156+
);
156157
if (isFollowed) {
157-
updatedFollowedTopics
158-
.removeWhere((t) => t.id == topic.id);
158+
updatedFollowedTopics.removeWhere(
159+
(t) => t.id == topic.id,
160+
);
159161
} else {
160162
updatedFollowedTopics.add(topic);
161163
}
162164

163-
final updatedPreferences =
164-
userContentPreferences.copyWith(
165-
followedTopics: updatedFollowedTopics,
166-
);
165+
final updatedPreferences = userContentPreferences
166+
.copyWith(
167+
followedTopics: updatedFollowedTopics,
168+
);
167169

168170
context.read<AppBloc>().add(
169-
AppUserContentPreferencesChanged(
170-
preferences: updatedPreferences,
171-
),
172-
);
171+
AppUserContentPreferencesChanged(
172+
preferences: updatedPreferences,
173+
),
174+
);
173175
},
174176
),
175177
contentPadding: const EdgeInsets.symmetric(

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ class FollowedTopicsListPage extends StatelessWidget {
5050
return FailureStateWidget(
5151
exception: appState.initialUserPreferencesError!,
5252
onRetry: () {
53-
context.read<AppBloc>().add(
54-
AppStarted(initialUser: user),
55-
);
53+
context.read<AppBloc>().add(AppStarted(initialUser: user));
5654
},
5755
);
5856
}
@@ -94,20 +92,19 @@ class FollowedTopicsListPage extends StatelessWidget {
9492
),
9593
tooltip: l10n.unfollowTopicTooltip(topic.name),
9694
onPressed: () {
97-
final updatedFollowedTopics =
98-
List<Topic>.from(followedTopics)
99-
..removeWhere((t) => t.id == topic.id);
95+
final updatedFollowedTopics = List<Topic>.from(
96+
followedTopics,
97+
)..removeWhere((t) => t.id == topic.id);
10098

101-
final updatedPreferences =
102-
userContentPreferences.copyWith(
99+
final updatedPreferences = userContentPreferences.copyWith(
103100
followedTopics: updatedFollowedTopics,
104101
);
105102

106103
context.read<AppBloc>().add(
107-
AppUserContentPreferencesChanged(
108-
preferences: updatedPreferences,
109-
),
110-
);
104+
AppUserContentPreferencesChanged(
105+
preferences: updatedPreferences,
106+
),
107+
);
111108
},
112109
),
113110
onTap: () async {

lib/account/view/saved_headlines_page.dart

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class SavedHeadlinesPage extends StatelessWidget {
5151
return FailureStateWidget(
5252
exception: appState.initialUserPreferencesError!,
5353
onRetry: () {
54-
context.read<AppBloc>().add(
55-
AppStarted(initialUser: user),
56-
);
54+
context.read<AppBloc>().add(AppStarted(initialUser: user));
5755
},
5856
);
5957
}
@@ -95,27 +93,28 @@ class SavedHeadlinesPage extends StatelessWidget {
9593
),
9694
itemBuilder: (context, index) {
9795
final headline = savedHeadlines[index];
98-
final imageStyle = appState.settings?.feedPreferences.headlineImageStyle ??
99-
HeadlineImageStyle.smallThumbnail; // Default if settings not loaded
96+
final imageStyle =
97+
appState.settings?.feedPreferences.headlineImageStyle ??
98+
HeadlineImageStyle
99+
.smallThumbnail; // Default if settings not loaded
100100

101101
final trailingButton = IconButton(
102102
icon: Icon(Icons.delete_outline, color: colorScheme.error),
103103
tooltip: l10n.headlineDetailsRemoveFromSavedTooltip,
104104
onPressed: () {
105-
final updatedSavedHeadlines =
106-
List<Headline>.from(savedHeadlines)
107-
..removeWhere((h) => h.id == headline.id);
105+
final updatedSavedHeadlines = List<Headline>.from(
106+
savedHeadlines,
107+
)..removeWhere((h) => h.id == headline.id);
108108

109-
final updatedPreferences =
110-
userContentPreferences.copyWith(
109+
final updatedPreferences = userContentPreferences.copyWith(
111110
savedHeadlines: updatedSavedHeadlines,
112111
);
113112

114113
context.read<AppBloc>().add(
115-
AppUserContentPreferencesChanged(
116-
preferences: updatedPreferences,
117-
),
118-
);
114+
AppUserContentPreferencesChanged(
115+
preferences: updatedPreferences,
116+
),
117+
);
119118
},
120119
);
121120

lib/ads/widgets/feed_ad_loader_widget.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ class _FeedAdLoaderWidgetState extends State<FeedAdLoaderWidget> {
204204
}
205205

206206
// Get the current HeadlineImageStyle from AppBloc
207-
final headlineImageStyle = context.read<AppBloc>().state.headlineImageStyle;
207+
final headlineImageStyle = context
208+
.read<AppBloc>()
209+
.state
210+
.headlineImageStyle;
208211

209212
// Call AdService.getFeedAd with the full AdConfig and adType from the placeholder.
210213
final loadedAd = await _adService.getFeedAd(

0 commit comments

Comments
 (0)