Skip to content

Commit fdfe26f

Browse files
committed
style: format
1 parent b0514b1 commit fdfe26f

File tree

9 files changed

+66
-58
lines changed

9 files changed

+66
-58
lines changed

lib/app_configuration/widgets/article_ad_settings_form.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class _ArticleAdSettingsFormState extends State<ArticleAdSettingsForm>
203203
children: [
204204
SwitchListTile(
205205
title: Text(l10n.enableInArticleAdsForRoleLabel(role.l10n(context))),
206-
value: roleSlots != null, // Value is true if roleSlots exists
206+
value: roleSlots != null,
207207
onChanged: (value) {
208208
final newVisibleTo =
209209
Map<AppUserRole, Map<InArticleAdSlotType, bool>>.from(

lib/app_configuration/widgets/feed_ad_settings_form.dart

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
3939
/// Controllers for ad placement interval fields, mapped by user role.
4040
/// These are used to manage text input for each role's ad placement interval.
4141
late final Map<AppUserRole, TextEditingController>
42-
_adPlacementIntervalControllers;
42+
_adPlacementIntervalControllers;
4343

4444
@override
4545
void initState() {
@@ -59,20 +59,26 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
5959
final feedAdConfig = widget.remoteConfig.adConfig.feedAdConfiguration;
6060
_adFrequencyControllers = {
6161
for (final role in AppUserRole.values)
62-
role: TextEditingController(
63-
text: _getAdFrequency(feedAdConfig, role).toString(),
64-
)..selection = TextSelection.collapsed(
65-
offset: _getAdFrequency(feedAdConfig, role).toString().length,
66-
),
62+
role:
63+
TextEditingController(
64+
text: _getAdFrequency(feedAdConfig, role).toString(),
65+
)
66+
..selection = TextSelection.collapsed(
67+
offset: _getAdFrequency(feedAdConfig, role).toString().length,
68+
),
6769
};
6870
_adPlacementIntervalControllers = {
6971
for (final role in AppUserRole.values)
70-
role: TextEditingController(
71-
text: _getAdPlacementInterval(feedAdConfig, role).toString(),
72-
)..selection = TextSelection.collapsed(
73-
offset:
74-
_getAdPlacementInterval(feedAdConfig, role).toString().length,
75-
),
72+
role:
73+
TextEditingController(
74+
text: _getAdPlacementInterval(feedAdConfig, role).toString(),
75+
)
76+
..selection = TextSelection.collapsed(
77+
offset: _getAdPlacementInterval(
78+
feedAdConfig,
79+
role,
80+
).toString().length,
81+
),
7682
};
7783
}
7884

@@ -89,20 +95,21 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
8995
);
9096
}
9197

92-
final newPlacementIntervalValue =
93-
_getAdPlacementInterval(feedAdConfig, role).toString();
98+
final newPlacementIntervalValue = _getAdPlacementInterval(
99+
feedAdConfig,
100+
role,
101+
).toString();
94102
if (_adPlacementIntervalControllers[role]?.text !=
95103
newPlacementIntervalValue) {
96104
_adPlacementIntervalControllers[role]?.text = newPlacementIntervalValue;
97105
_adPlacementIntervalControllers[role]?.selection =
98106
TextSelection.collapsed(
99-
offset: newPlacementIntervalValue.length,
100-
);
107+
offset: newPlacementIntervalValue.length,
108+
);
101109
}
102110
}
103111
}
104112

105-
106113
@override
107114
void didUpdateWidget(covariant FeedAdSettingsForm oldWidget) {
108115
super.didUpdateWidget(oldWidget);
@@ -233,7 +240,7 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
233240
),
234241
const SizedBox(height: AppSpacing.lg),
235242
SizedBox(
236-
height: 350, // Increased height for better spacing
243+
height: 350,
237244
child: TabBarView(
238245
controller: _tabController,
239246
children: AppUserRole.values
@@ -271,10 +278,9 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
271278
children: [
272279
SwitchListTile(
273280
title: Text(l10n.visibleToRoleLabel(role.l10n(context))),
274-
value: roleConfig != null, // Value is true if roleConfig exists
281+
value: roleConfig != null,
275282
onChanged: (value) {
276-
final newVisibleTo =
277-
Map<AppUserRole, FeedAdFrequencyConfig>.from(
283+
final newVisibleTo = Map<AppUserRole, FeedAdFrequencyConfig>.from(
278284
config.visibleTo,
279285
);
280286
if (value) {
@@ -310,12 +316,13 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
310316
description: l10n.adFrequencyDescription,
311317
value: roleConfig.adFrequency,
312318
onChanged: (value) {
313-
final newRoleConfig =
314-
roleConfig.copyWith(adFrequency: value);
319+
final newRoleConfig = roleConfig.copyWith(
320+
adFrequency: value,
321+
);
315322
final newVisibleTo =
316323
Map<AppUserRole, FeedAdFrequencyConfig>.from(
317-
config.visibleTo,
318-
)..[role] = newRoleConfig;
324+
config.visibleTo,
325+
)..[role] = newRoleConfig;
319326
widget.onConfigChanged(
320327
widget.remoteConfig.copyWith(
321328
adConfig: widget.remoteConfig.adConfig.copyWith(
@@ -333,12 +340,13 @@ class _FeedAdSettingsFormState extends State<FeedAdSettingsForm>
333340
description: l10n.adPlacementIntervalDescription,
334341
value: roleConfig.adPlacementInterval,
335342
onChanged: (value) {
336-
final newRoleConfig =
337-
roleConfig.copyWith(adPlacementInterval: value);
343+
final newRoleConfig = roleConfig.copyWith(
344+
adPlacementInterval: value,
345+
);
338346
final newVisibleTo =
339347
Map<AppUserRole, FeedAdFrequencyConfig>.from(
340-
config.visibleTo,
341-
)..[role] = newRoleConfig;
348+
config.visibleTo,
349+
)..[role] = newRoleConfig;
342350
widget.onConfigChanged(
343351
widget.remoteConfig.copyWith(
344352
adConfig: widget.remoteConfig.adConfig.copyWith(

lib/app_configuration/widgets/interstitial_ad_settings_form.dart

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
3535
/// Controllers for transitions before showing interstitial ads, mapped by user role.
3636
/// These are used to manage text input for each role's interstitial ad frequency.
3737
late final Map<AppUserRole, TextEditingController>
38-
_transitionsBeforeShowingInterstitialAdsControllers;
38+
_transitionsBeforeShowingInterstitialAdsControllers;
3939

4040
@override
4141
void initState() {
@@ -56,17 +56,19 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
5656
widget.remoteConfig.adConfig.interstitialAdConfiguration;
5757
_transitionsBeforeShowingInterstitialAdsControllers = {
5858
for (final role in AppUserRole.values)
59-
role: TextEditingController(
60-
text: _getTransitionsBeforeInterstitial(
61-
interstitialConfig,
62-
role,
63-
).toString(),
64-
)..selection = TextSelection.collapsed(
65-
offset: _getTransitionsBeforeInterstitial(
66-
interstitialConfig,
67-
role,
68-
).toString().length,
69-
),
59+
role:
60+
TextEditingController(
61+
text: _getTransitionsBeforeInterstitial(
62+
interstitialConfig,
63+
role,
64+
).toString(),
65+
)
66+
..selection = TextSelection.collapsed(
67+
offset: _getTransitionsBeforeInterstitial(
68+
interstitialConfig,
69+
role,
70+
).toString().length,
71+
),
7072
};
7173
}
7274

@@ -86,13 +88,12 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
8688
newInterstitialValue;
8789
_transitionsBeforeShowingInterstitialAdsControllers[role]?.selection =
8890
TextSelection.collapsed(
89-
offset: newInterstitialValue.length,
90-
);
91+
offset: newInterstitialValue.length,
92+
);
9193
}
9294
}
9395
}
9496

95-
9697
@override
9798
void didUpdateWidget(covariant InterstitialAdSettingsForm oldWidget) {
9899
super.didUpdateWidget(oldWidget);
@@ -104,8 +105,7 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
104105

105106
@override
106107
void dispose() {
107-
_tabController
108-
.dispose();
108+
_tabController.dispose();
109109
for (final controller
110110
in _transitionsBeforeShowingInterstitialAdsControllers.values) {
111111
controller.dispose();
@@ -210,12 +210,12 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
210210
children: [
211211
SwitchListTile(
212212
title: Text(l10n.visibleToRoleLabel(role.l10n(context))),
213-
value: roleConfig != null, // Value is true if roleConfig exists
213+
value: roleConfig != null,
214214
onChanged: (value) {
215215
final newVisibleTo =
216216
Map<AppUserRole, InterstitialAdFrequencyConfig>.from(
217-
config.visibleTo,
218-
);
217+
config.visibleTo,
218+
);
219219
if (value) {
220220
// Default value when enabling for a role
221221
newVisibleTo[role] = const InterstitialAdFrequencyConfig(
@@ -251,8 +251,8 @@ class _InterstitialAdSettingsFormState extends State<InterstitialAdSettingsForm>
251251
);
252252
final newVisibleTo =
253253
Map<AppUserRole, InterstitialAdFrequencyConfig>.from(
254-
config.visibleTo,
255-
)..[role] = newRoleConfig;
254+
config.visibleTo,
255+
)..[role] = newRoleConfig;
256256
widget.onConfigChanged(
257257
widget.remoteConfig.copyWith(
258258
adConfig: widget.remoteConfig.adConfig.copyWith(

lib/content_management/view/create_headline_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class _CreateHeadlineViewState extends State<_CreateHeadlineView> {
122122
);
123123
}
124124
}
125-
: null, // Disable button if form is not valid
125+
: null,
126126
);
127127
},
128128
),

lib/content_management/view/create_source_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class _CreateSourceViewState extends State<_CreateSourceView> {
119119
);
120120
}
121121
}
122-
: null, // Disable button if form is not valid
122+
: null,
123123
);
124124
},
125125
),

lib/content_management/view/create_topic_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class _CreateTopicViewState extends State<_CreateTopicView> {
119119
);
120120
}
121121
}
122-
: null, // Disable button if form is not valid
122+
: null,
123123
);
124124
},
125125
),

lib/content_management/view/edit_headline_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class _EditHeadlineViewState extends State<_EditHeadlineView> {
112112
}
113113
}
114114
}
115-
: null, // Disable button if form is not valid
115+
: null,
116116
);
117117
},
118118
),

lib/content_management/view/edit_source_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class _EditSourceViewState extends State<_EditSourceView> {
106106
}
107107
}
108108
}
109-
: null, // Disable button if form is not valid
109+
: null,
110110
);
111111
},
112112
),

lib/content_management/view/edit_topic_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class _EditTopicViewState extends State<_EditTopicView> {
106106
}
107107
}
108108
}
109-
: null, // Disable button if form is not valid
109+
: null,
110110
);
111111
},
112112
),

0 commit comments

Comments
 (0)