Skip to content

Commit

Permalink
fix: linting and analyzer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
OutdatedGuy committed Dec 11, 2023
1 parent 4e57de0 commit 4c891c1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
7 changes: 1 addition & 6 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ analyzer:
missing_return: warning
# allow having TODOs in the code
todo: ignore
# Ignore analyzer hints for updating pubspecs when using Future or
# Stream and not importing dart:async
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core: ignore
exclude:
- "bin/cache/**"
# the following two are relative to the stocks example and the flutter package respectively
Expand Down Expand Up @@ -55,10 +51,9 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- collection_methods_unrelated_type
- library_names
- library_prefixes
- list_remove_unrelated_type
- no_adjacent_strings_in_list
- no_duplicate_case_values
- non_constant_identifier_names
Expand Down
6 changes: 3 additions & 3 deletions lib/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void modifyContentsFile(String newIconName) {
String generateContentsFileAsString(String newIconName) {
final Map<String, dynamic> contentJson = <String, dynamic>{
'images': createImageList(newIconName),
'info': ContentsInfoObject(version: 1, author: 'xcode').toJson()
'info': ContentsInfoObject(version: 1, author: 'xcode').toJson(),
};
return json.encode(contentJson);
}
Expand All @@ -220,7 +220,7 @@ class ContentsImageObject {
'size': size,
'idiom': idiom,
'filename': filename,
'scale': scale
'scale': scale,
};
}
}
Expand Down Expand Up @@ -390,7 +390,7 @@ List<Map<String, String>> createImageList(String fileNamePrefix) {
idiom: 'ios-marketing',
filename: '$fileNamePrefix-1024x1024@1x.png',
scale: '1x',
).toJson()
).toJson(),
];
return imageList;
}
Expand Down
6 changes: 3 additions & 3 deletions test/android_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': true,
'ios': true
'ios': true,
};
expect(
Config.fromJson(flutterIconsConfig).isCustomAndroidFile,
Expand All @@ -42,7 +42,7 @@ void main() {
final Map<String, dynamic> flutterIconsNewIconConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': 'New Icon',
'ios': true
'ios': true,
};
expect(
Config.fromJson(flutterIconsNewIconConfig).isCustomAndroidFile,
Expand All @@ -55,7 +55,7 @@ void main() {
'image_path': 'assets/images/icon-710x599.png',
'image_path_android': 'assets/images/icon-android.png',
'android': 'New Icon',
'ios': true
'ios': true,
};
expect(
Config.fromJson(flutterIconsNewIconConfig).getImagePathAndroid(),
Expand Down
18 changes: 9 additions & 9 deletions test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ flutter_launcher_icons:
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': true,
'ios': true
'ios': true,
};
final config = Config.fromJson(flutterIconsConfig);
expect(
Expand All @@ -122,7 +122,7 @@ flutter_launcher_icons:
final Map<String, dynamic> flutterIconsConfigAndroid = <String, dynamic>{
'image_path_android': 'assets/images/icon-710x599.png',
'android': true,
'ios': true
'ios': true,
};
final configAndroid = Config.fromJson(flutterIconsConfigAndroid);
expect(
Expand All @@ -134,7 +134,7 @@ flutter_launcher_icons:
'image_path_android': 'assets/images/icon-android.png',
'image_path_ios': 'assets/images/icon-ios.png',
'android': true,
'ios': true
'ios': true,
};
final configBoth = Config.fromJson(flutterIconsConfigBoth);
expect(
Expand All @@ -148,15 +148,15 @@ flutter_launcher_icons:
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': true,
'ios': true
'ios': true,
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.hasPlatformConfig, isTrue);
});

test('No platform specified in config', () {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png'
'image_path': 'assets/images/icon-710x599.png',
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.hasPlatformConfig, isFalse);
Expand All @@ -166,7 +166,7 @@ flutter_launcher_icons:
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': false,
'ios': true
'ios': true,
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.isNeedingNewAndroidIcon, isFalse);
Expand All @@ -175,7 +175,7 @@ flutter_launcher_icons:
test('No new Android icon needed - no Android config', () {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'ios': true
'ios': true,
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.isNeedingNewAndroidIcon, isFalse);
Expand All @@ -185,7 +185,7 @@ flutter_launcher_icons:
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': true,
'ios': false
'ios': false,
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.isNeedingNewIOSIcon, isFalse);
Expand All @@ -194,7 +194,7 @@ flutter_launcher_icons:
test('No new iOS icon needed - no iOS config', () {
final Map<String, dynamic> flutterIconsConfig = <String, dynamic>{
'image_path': 'assets/images/icon-710x599.png',
'android': true
'android': true,
};
final config = Config.fromJson(flutterIconsConfig);
expect(config.isNeedingNewIOSIcon, isFalse);
Expand Down
2 changes: 1 addition & 1 deletion test/web/web_icon_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void main() {
d.file('manifest.json', anything),
]),
d.file('flutter_launcher_icons.yaml', anything),
d.file('pubspec.yaml', templates.pubspecTemplate)
d.file('pubspec.yaml', templates.pubspecTemplate),
]).validate(),
completes,
);
Expand Down
4 changes: 2 additions & 2 deletions test/web/web_template_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
equals({
'src': 'icons/Icon-512.png',
'sizes': '512x512',
'type': 'image/png'
'type': 'image/png',
}),
);
expect(
Expand All @@ -31,7 +31,7 @@ void main() {
'src': 'icons/Icon-maskable-512.png',
'sizes': '512x512',
'type': 'image/png',
'purpose': 'maskable'
'purpose': 'maskable',
}),
);
});
Expand Down

0 comments on commit 4c891c1

Please sign in to comment.