Skip to content

Commit ee51f79

Browse files
committed
style: misc format
1 parent c759420 commit ee51f79

File tree

11 files changed

+56
-52
lines changed

11 files changed

+56
-52
lines changed

lib/ads/models/ad_theme_style.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AdThemeStyle extends Equatable {
3939

4040
return AdThemeStyle(
4141
mainBackgroundColor: colorScheme.surface,
42-
cornerRadius: AppSpacing.sm,
42+
cornerRadius: AppSpacing.sm,
4343
callToActionTextColor: colorScheme.onPrimary,
4444
callToActionBackgroundColor: colorScheme.primary,
4545
callToActionTextSize: textTheme.labelLarge?.fontSize,
@@ -99,19 +99,19 @@ class AdThemeStyle extends Equatable {
9999

100100
@override
101101
List<Object?> get props => [
102-
mainBackgroundColor,
103-
cornerRadius,
104-
callToActionTextColor,
105-
callToActionBackgroundColor,
106-
callToActionTextSize,
107-
primaryTextColor,
108-
primaryBackgroundColor,
109-
primaryTextSize,
110-
secondaryTextColor,
111-
secondaryBackgroundColor,
112-
secondaryTextSize,
113-
tertiaryTextColor,
114-
tertiaryBackgroundColor,
115-
tertiaryTextSize,
116-
];
102+
mainBackgroundColor,
103+
cornerRadius,
104+
callToActionTextColor,
105+
callToActionBackgroundColor,
106+
callToActionTextSize,
107+
primaryTextColor,
108+
primaryBackgroundColor,
109+
primaryTextSize,
110+
secondaryTextColor,
111+
secondaryBackgroundColor,
112+
secondaryTextSize,
113+
tertiaryTextColor,
114+
tertiaryBackgroundColor,
115+
tertiaryTextSize,
116+
];
117117
}

lib/ads/widgets/ad_feed_item_widget.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ import 'package:ui_kit/ui_kit.dart';
1616
/// {@endtemplate}
1717
class AdFeedItemWidget extends StatelessWidget {
1818
/// {@macro ad_feed_item_widget}
19-
const AdFeedItemWidget({
20-
required this.adFeedItem,
21-
super.key,
22-
});
19+
const AdFeedItemWidget({required this.adFeedItem, super.key});
2320

2421
/// The ad feed item containing the loaded native ad to be displayed.
2522
final AdFeedItem adFeedItem;
@@ -60,6 +57,6 @@ class _AdDispatcher extends StatelessWidget {
6057
case AdProviderType.admob:
6158
// If the provider is AdMob, render the AdmobNativeAdWidget.
6259
return AdmobNativeAdWidget(nativeAd: nativeAd);
63-
}
60+
}
6461
}
6562
}

lib/ads/widgets/admob_native_ad_widget.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import 'package:logging/logging.dart';
1414
/// {@endtemplate}
1515
class AdmobNativeAdWidget extends StatelessWidget {
1616
/// {@macro admob_native_ad_widget}
17-
const AdmobNativeAdWidget({
18-
required this.nativeAd,
19-
super.key,
20-
});
17+
const AdmobNativeAdWidget({required this.nativeAd, super.key});
2118

2219
/// The generic native ad model which contains the provider-specific ad object.
2320
final app_ad_models.NativeAd nativeAd;

lib/entity_details/bloc/entity_details_bloc.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ class EntityDetailsBloc extends Bloc<EntityDetailsEvent, EntityDetailsState> {
218218
adConfig: remoteConfig.adConfig,
219219
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
220220
adThemeStyle: AdThemeStyle.fromTheme(
221-
ThemeData(brightness: _appBloc.state.themeMode == ThemeMode.dark ? Brightness.dark : Brightness.light),
221+
ThemeData(
222+
brightness: _appBloc.state.themeMode == ThemeMode.dark
223+
? Brightness.dark
224+
: Brightness.light,
225+
),
222226
), // Use a default AdThemeStyle for pagination if not passed
223227
// Calculate the count of actual content items (headlines) already in the
224228
// feed. This is crucial for the FeedDecoratorService to correctly apply

lib/headlines-feed/bloc/headlines_feed_bloc.dart

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:bloc_concurrency/bloc_concurrency.dart';
55
import 'package:core/core.dart';
66
import 'package:data_repository/data_repository.dart';
77
import 'package:equatable/equatable.dart';
8-
import 'package:flutter/material.dart';
98
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
109
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
1110
import 'package:flutter_news_app_mobile_client_full_source_code/headlines-feed/models/headline_filter.dart';
@@ -115,8 +114,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
115114
feedItems: headlineResponse.items,
116115
user: currentUser,
117116
adConfig: remoteConfig.adConfig,
118-
imageStyle:
119-
_appBloc.state.settings.feedPreferences.headlineImageStyle,
117+
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
120118
adThemeStyle: event.adThemeStyle,
121119
// Calculate the count of actual content items (headlines) already in the
122120
// feed. This is crucial for the FeedDecoratorService to correctly apply
@@ -171,8 +169,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
171169
userPreferences?.followedTopics.map((t) => t.id).toList() ?? [],
172170
followedSourceIds:
173171
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
174-
imageStyle:
175-
_appBloc.state.settings.feedPreferences.headlineImageStyle,
172+
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
176173
adThemeStyle: event.adThemeStyle,
177174
);
178175

@@ -253,8 +250,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
253250
userPreferences?.followedTopics.map((t) => t.id).toList() ?? [],
254251
followedSourceIds:
255252
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
256-
imageStyle:
257-
_appBloc.state.settings.feedPreferences.headlineImageStyle,
253+
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
258254
adThemeStyle: event.adThemeStyle,
259255
);
260256

@@ -332,8 +328,7 @@ class HeadlinesFeedBloc extends Bloc<HeadlinesFeedEvent, HeadlinesFeedState> {
332328
userPreferences?.followedTopics.map((t) => t.id).toList() ?? [],
333329
followedSourceIds:
334330
userPreferences?.followedSources.map((s) => s.id).toList() ?? [],
335-
imageStyle:
336-
_appBloc.state.settings.feedPreferences.headlineImageStyle,
331+
imageStyle: _appBloc.state.settings.feedPreferences.headlineImageStyle,
337332
adThemeStyle: event.adThemeStyle,
338333
);
339334

lib/headlines-feed/bloc/headlines_feed_event.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ sealed class HeadlinesFeedEvent extends Equatable {
1818
final class HeadlinesFeedFetchRequested extends HeadlinesFeedEvent {
1919
/// {@macro headlines_feed_fetch_requested}
2020
///
21-
/// Optionally includes a [cursor] to fetch the next page. If [cursor] is null,
22-
/// it typically indicates an initial fetch request.
21+
/// Optionally includes a [cursor] to fetch the next page. If [cursor] is null,
22+
/// it typically indicates an initial fetch request.
2323
const HeadlinesFeedFetchRequested({required this.adThemeStyle, this.cursor});
2424

2525
/// The cursor indicating the starting point for the next page of headlines.

lib/headlines-feed/view/headlines_feed_page.dart

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ class _HeadlinesFeedPageState extends State<HeadlinesFeedPage> {
6565
state.hasMore &&
6666
state.status != HeadlinesFeedStatus.loadingMore) {
6767
context.read<HeadlinesFeedBloc>().add(
68-
HeadlinesFeedFetchRequested(adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context))),
68+
HeadlinesFeedFetchRequested(
69+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
70+
),
6971
);
7072
}
7173
}
@@ -185,7 +187,9 @@ class _HeadlinesFeedPageState extends State<HeadlinesFeedPage> {
185187
return FailureStateWidget(
186188
exception: state.error!,
187189
onRetry: () => context.read<HeadlinesFeedBloc>().add(
188-
HeadlinesFeedRefreshRequested(adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context))),
190+
HeadlinesFeedRefreshRequested(
191+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
192+
),
189193
),
190194
);
191195
}
@@ -204,7 +208,11 @@ class _HeadlinesFeedPageState extends State<HeadlinesFeedPage> {
204208
const SizedBox(height: AppSpacing.lg),
205209
ElevatedButton(
206210
onPressed: () => context.read<HeadlinesFeedBloc>().add(
207-
HeadlinesFeedFiltersCleared(adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context))),
211+
HeadlinesFeedFiltersCleared(
212+
adThemeStyle: AdThemeStyle.fromTheme(
213+
Theme.of(context),
214+
),
215+
),
208216
),
209217
child: Text(l10n.headlinesFeedClearFiltersButton),
210218
),
@@ -216,7 +224,9 @@ class _HeadlinesFeedPageState extends State<HeadlinesFeedPage> {
216224
return RefreshIndicator(
217225
onRefresh: () async {
218226
context.read<HeadlinesFeedBloc>().add(
219-
HeadlinesFeedRefreshRequested(adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context))),
227+
HeadlinesFeedRefreshRequested(
228+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
229+
),
220230
);
221231
},
222232
child: ListView.separated(

lib/headlines-feed/view/headlines_filter_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ class _HeadlinesFilterPageState extends State<HeadlinesFilterPage> {
271271
tooltip: l10n.headlinesFeedFilterResetButton,
272272
onPressed: () {
273273
context.read<HeadlinesFeedBloc>().add(
274-
HeadlinesFeedFiltersCleared(adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context))),
274+
HeadlinesFeedFiltersCleared(
275+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
276+
),
275277
);
276278
// Also reset local state for the checkbox
277279
setState(() {

lib/headlines-search/bloc/headlines_search_bloc.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:bloc_concurrency/bloc_concurrency.dart';
55
import 'package:core/core.dart';
66
import 'package:data_repository/data_repository.dart';
77
import 'package:equatable/equatable.dart';
8-
import 'package:flutter/material.dart';
98
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
109
import 'package:flutter_news_app_mobile_client_full_source_code/app/bloc/app_bloc.dart';
1110
import 'package:flutter_news_app_mobile_client_full_source_code/shared/services/feed_decorator_service.dart';

lib/router/router.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ GoRouter createRouter({
373373
feedDecoratorService: feedDecoratorService,
374374
appBloc: context.read<AppBloc>(),
375375
)..add(
376-
HeadlinesFeedFetchRequested(
377-
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
378-
),
379-
);
376+
HeadlinesFeedFetchRequested(
377+
adThemeStyle: AdThemeStyle.fromTheme(Theme.of(context)),
378+
),
379+
);
380380
},
381381
),
382382
BlocProvider(

0 commit comments

Comments
 (0)