Skip to content

Commit

Permalink
style: fixed linting warnings on pub website
Browse files Browse the repository at this point in the history
  • Loading branch information
OutdatedGuy authored and MarkOSullivan94 committed May 4, 2023
1 parent b827871 commit 45bfbfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
9 changes: 4 additions & 5 deletions lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ class Config {
this.macOSConfig,
});


/// Creates [Config] for given [flavor] and [prefixPath]
static Config? loadConfigFromFlavor(
String flavor,
String prefixPath,
) {
String flavor,
String prefixPath,
) {
return _getConfigFromPubspecYaml(
prefix: prefixPath,
pathToPubspecYamlFile: utils.flavorConfigFile(flavor),
Expand Down Expand Up @@ -74,7 +73,7 @@ class Config {
try {
return yaml.checkedYamlDecode<Config?>(
configContent,
(Map<dynamic, dynamic>? json) {
(Map<dynamic, dynamic>? json) {
if (json != null) {
// if we have flutter_icons configuration ...
if (json['flutter_icons'] != null) {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/web_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ class WebConfig {

@override
String toString() => 'WebConfig: ${toJson()}';
}
}
15 changes: 5 additions & 10 deletions test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ flutter_launcher_icons:
ios: false
''');
final ArgResults argResults = parser.parse(<String>[]);
final Config? config =
main_dart.loadConfigFileFromArgResults(argResults);
final Config? config = main_dart.loadConfigFileFromArgResults(argResults);
expect(config, isNotNull);
expect(config!.android, isTrue);
});
Expand All @@ -76,8 +75,7 @@ flutter_launcher_icons:
ios: false
''');
ArgResults argResults = parser.parse(<String>[]);
final Config? config =
main_dart.loadConfigFileFromArgResults(argResults);
final Config? config = main_dart.loadConfigFileFromArgResults(argResults);
expect(config, isNotNull);
expect(config!.ios, isFalse);

Expand All @@ -95,8 +93,7 @@ flutter_launcher_icons:
''');
// if no argument set, should fail
ArgResults argResults = parser.parse(<String>['-f', 'custom.yaml']);
final Config? config =
main_dart.loadConfigFileFromArgResults(argResults);
final Config? config = main_dart.loadConfigFileFromArgResults(argResults);
expect(config, isNotNull);
expect(config!.ios, isTrue);

Expand Down Expand Up @@ -127,8 +124,7 @@ flutter_launcher_icons:
'android': true,
'ios': true
};
final configAndroid =
Config.fromJson(flutterIconsConfigAndroid);
final configAndroid = Config.fromJson(flutterIconsConfigAndroid);
expect(
configAndroid.getImagePathAndroid(),
equals('assets/images/icon-710x599.png'),
Expand All @@ -140,8 +136,7 @@ flutter_launcher_icons:
'android': true,
'ios': true
};
final configBoth =
Config.fromJson(flutterIconsConfigBoth);
final configBoth = Config.fromJson(flutterIconsConfigBoth);
expect(
configBoth.getImagePathAndroid(),
equals('assets/images/icon-android.png'),
Expand Down

0 comments on commit 45bfbfa

Please sign in to comment.