Skip to content

Commit 8fef32b

Browse files
committed
style: misc
1 parent 3999b19 commit 8fef32b

File tree

8 files changed

+82
-44
lines changed

8 files changed

+82
-44
lines changed

lib/src/models/news/source.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ class Source extends FeedItem {
4949
/// If an unknown value is encountered during deserialization,
5050
/// this field will be set to null.
5151
@JsonKey(
52-
name: 'sourceType', unknownEnumValue: JsonKey.nullForUndefinedEnumValue,)
52+
name: 'sourceType',
53+
unknownEnumValue: JsonKey.nullForUndefinedEnumValue,
54+
)
5355
final SourceType? _sourceType;
5456

5557
/// Public getter for the source type.

test/src/models/feed/feed_item_action_test.dart

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@ void main() {
186186
};
187187
final action = feedItemActionFromJson(json);
188188
expect(action, isA<ShowInterstitialThenOpenInternalContent>());
189-
expect((action as ShowInterstitialThenOpenInternalContent).contentId,
190-
'id2',);
189+
expect(
190+
(action as ShowInterstitialThenOpenInternalContent).contentId,
191+
'id2',
192+
);
191193
expect(action.contentType, ContentType.category);
192194
});
193195

@@ -205,23 +207,27 @@ void main() {
205207
final json = <String, dynamic>{'contentId': 'id1'};
206208
expect(
207209
() => feedItemActionFromJson(json),
208-
throwsA(isA<FormatException>().having(
209-
(e) => e.message,
210-
'message',
211-
'Missing "type" field in FeedItemAction JSON.',
212-
),),
210+
throwsA(
211+
isA<FormatException>().having(
212+
(e) => e.message,
213+
'message',
214+
'Missing "type" field in FeedItemAction JSON.',
215+
),
216+
),
213217
);
214218
});
215219

216220
test('throws FormatException if type is unknown', () {
217221
final json = <String, dynamic>{'type': 'unknown_type'};
218222
expect(
219223
() => feedItemActionFromJson(json),
220-
throwsA(isA<FormatException>().having(
221-
(e) => e.message,
222-
'message',
223-
'Unknown FeedItemAction type: unknown_type',
224-
),),
224+
throwsA(
225+
isA<FormatException>().having(
226+
(e) => e.message,
227+
'message',
228+
'Unknown FeedItemAction type: unknown_type',
229+
),
230+
),
225231
);
226232
});
227233
});

test/src/models/feed/feed_item_test.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,27 @@ void main() {
108108
final json = <String, dynamic>{'id': 'some-id'};
109109
expect(
110110
() => FeedItem.fromJson(json),
111-
throwsA(isA<FormatException>().having(
112-
(e) => e.message,
113-
'message',
114-
'Missing "type" field in FeedItem JSON.',
115-
),),
111+
throwsA(
112+
isA<FormatException>().having(
113+
(e) => e.message,
114+
'message',
115+
'Missing "type" field in FeedItem JSON.',
116+
),
117+
),
116118
);
117119
});
118120

119121
test('throws FormatException if type is unknown', () {
120122
final json = <String, dynamic>{'type': 'unknown_type'};
121123
expect(
122124
() => FeedItem.fromJson(json),
123-
throwsA(isA<FormatException>().having(
124-
(e) => e.message,
125-
'message',
126-
'Unknown FeedItem type: unknown_type',
127-
),),
125+
throwsA(
126+
isA<FormatException>().having(
127+
(e) => e.message,
128+
'message',
129+
'Unknown FeedItem type: unknown_type',
130+
),
131+
),
128132
);
129133
});
130134
});

test/src/models/feed/source_type_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ void main() {
88
expect(SourceType.localNewsOutlet.name, 'localNewsOutlet');
99
expect(SourceType.nationalNewsOutlet.name, 'nationalNewsOutlet');
1010
expect(
11-
SourceType.internationalNewsOutlet.name, 'internationalNewsOutlet',);
11+
SourceType.internationalNewsOutlet.name,
12+
'internationalNewsOutlet',
13+
);
1214
expect(SourceType.specializedPublisher.name, 'specializedPublisher');
1315
expect(SourceType.blog.name, 'blog');
1416
expect(SourceType.governmentSource.name, 'governmentSource');

test/src/models/news/source_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ void main() {
165165
expect(json['url'], testUrl);
166166
expect(json['type'], 'source');
167167
expect(
168-
json['sourceType'], 'specialized-publisher',); // Use direct string
168+
json['sourceType'],
169+
'specialized-publisher',
170+
); // Use direct string
169171
expect(json['language'], testLanguage);
170172
expect(json['headquarters'], testHeadquartersJson);
171173
expect(json['action'], defaultAction.toJson());

test/src/models/remote-config/ad_config_test.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ void main() {
2525
expect(adConfig.guestAdFrequency, testGuestAdFrequency);
2626
expect(adConfig.guestAdPlacementInterval, testGuestAdPlacementInterval);
2727
expect(adConfig.authenticatedAdFrequency, testAuthenticatedAdFrequency);
28-
expect(adConfig.authenticatedAdPlacementInterval,
29-
testAuthenticatedAdPlacementInterval,);
28+
expect(
29+
adConfig.authenticatedAdPlacementInterval,
30+
testAuthenticatedAdPlacementInterval,
31+
);
3032
expect(adConfig.premiumAdFrequency, testPremiumAdFrequency);
31-
expect(adConfig.premiumAdPlacementInterval,
32-
testPremiumAdPlacementInterval,);
33+
expect(
34+
adConfig.premiumAdPlacementInterval,
35+
testPremiumAdPlacementInterval,
36+
);
3337
});
3438
});
3539

test/src/models/user-settings/app_accent_theme_test.dart

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,27 @@ void main() {
1010
});
1111

1212
test('can be created from string values', () {
13-
expect(AppAccentTheme.values.byName('defaultBlue'),
14-
AppAccentTheme.defaultBlue,);
13+
expect(
14+
AppAccentTheme.values.byName('defaultBlue'),
15+
AppAccentTheme.defaultBlue,
16+
);
1517
expect(AppAccentTheme.values.byName('newsRed'), AppAccentTheme.newsRed);
16-
expect(AppAccentTheme.values.byName('graphiteGray'),
17-
AppAccentTheme.graphiteGray,);
18+
expect(
19+
AppAccentTheme.values.byName('graphiteGray'),
20+
AppAccentTheme.graphiteGray,
21+
);
1822
});
1923

2024
test('has correct toString representation', () {
2125
expect(
22-
AppAccentTheme.defaultBlue.toString(), 'AppAccentTheme.defaultBlue',);
26+
AppAccentTheme.defaultBlue.toString(),
27+
'AppAccentTheme.defaultBlue',
28+
);
2329
expect(AppAccentTheme.newsRed.toString(), 'AppAccentTheme.newsRed');
24-
expect(AppAccentTheme.graphiteGray.toString(),
25-
'AppAccentTheme.graphiteGray',);
30+
expect(
31+
AppAccentTheme.graphiteGray.toString(),
32+
'AppAccentTheme.graphiteGray',
33+
);
2634
});
2735
});
2836
}

test/src/models/user-settings/app_text_scale_factor_test.dart

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,31 @@ void main() {
1212

1313
test('can be created from string values', () {
1414
expect(
15-
AppTextScaleFactor.values.byName('small'), AppTextScaleFactor.small,);
16-
expect(AppTextScaleFactor.values.byName('medium'),
17-
AppTextScaleFactor.medium,);
15+
AppTextScaleFactor.values.byName('small'),
16+
AppTextScaleFactor.small,
17+
);
1818
expect(
19-
AppTextScaleFactor.values.byName('large'), AppTextScaleFactor.large,);
20-
expect(AppTextScaleFactor.values.byName('extraLarge'),
21-
AppTextScaleFactor.extraLarge,);
19+
AppTextScaleFactor.values.byName('medium'),
20+
AppTextScaleFactor.medium,
21+
);
22+
expect(
23+
AppTextScaleFactor.values.byName('large'),
24+
AppTextScaleFactor.large,
25+
);
26+
expect(
27+
AppTextScaleFactor.values.byName('extraLarge'),
28+
AppTextScaleFactor.extraLarge,
29+
);
2230
});
2331

2432
test('has correct toString representation', () {
2533
expect(AppTextScaleFactor.small.toString(), 'AppTextScaleFactor.small');
2634
expect(AppTextScaleFactor.medium.toString(), 'AppTextScaleFactor.medium');
2735
expect(AppTextScaleFactor.large.toString(), 'AppTextScaleFactor.large');
28-
expect(AppTextScaleFactor.extraLarge.toString(),
29-
'AppTextScaleFactor.extraLarge',);
36+
expect(
37+
AppTextScaleFactor.extraLarge.toString(),
38+
'AppTextScaleFactor.extraLarge',
39+
);
3040
});
3141
});
3242
}

0 commit comments

Comments
 (0)