diff --git a/analysis_options.yaml b/analysis_options.yaml index 3591d149b..4bf7d85dd 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -14,8 +14,9 @@ analyzer: linter: rules: # always_use_package_imports: true - avoid_equals_and_hash_code_on_mutable_classes: true avoid_classes_with_only_static_members: true + avoid_equals_and_hash_code_on_mutable_classes: true + curly_braces_in_flow_control_structures: true directives_ordering: true flutter_style_todos: true prefer_const_constructors: true @@ -23,11 +24,12 @@ linter: prefer_final_in_for_each: true prefer_int_literals: true prefer_single_quotes: true - # require_trailing_commas: true - # sort_constructors_first: true + require_trailing_commas: true + sort_constructors_first: true + sort_unnamed_constructors_first: true unawaited_futures: true unnecessary_await_in_return: true - use_to_and_as_if_applicable: true unnecessary_lambdas: true + use_to_and_as_if_applicable: true use_raw_strings: true use_super_parameters: false diff --git a/packages/command/bin/flutter_gen_command.dart b/packages/command/bin/flutter_gen_command.dart index 8679b1fcf..09ca191c0 100644 --- a/packages/command/bin/flutter_gen_command.dart +++ b/packages/command/bin/flutter_gen_command.dart @@ -47,7 +47,9 @@ void main(List args) async { } } on FormatException catch (e) { stderr.writeAll( - [e.message, 'usage: flutter_gen [options...]', ''], '\n'); + [e.message, 'usage: flutter_gen [options...]', ''], + '\n', + ); return; } diff --git a/packages/command/test/flutter_gen_command_test.dart b/packages/command/test/flutter_gen_command_test.dart index bfd6e6112..9c1b0dd2b 100644 --- a/packages/command/test/flutter_gen_command_test.dart +++ b/packages/command/test/flutter_gen_command_test.dart @@ -37,8 +37,10 @@ void main() { 'dart', ['bin/flutter_gen_command.dart', '--help'], ); - expect(await process.stdout.next, - equals('-c, --config Set the path of pubspec.yaml.')); + expect( + await process.stdout.next, + equals('-c, --config Set the path of pubspec.yaml.'), + ); final line = await process.stdout.next; expect(line.trim(), equals('(defaults to "pubspec.yaml")')); await process.shouldExit(0); diff --git a/packages/core/lib/flutter_generator.dart b/packages/core/lib/flutter_generator.dart index 2ac6e4f82..4663c5012 100644 --- a/packages/core/lib/flutter_generator.dart +++ b/packages/core/lib/flutter_generator.dart @@ -25,7 +25,9 @@ class FlutterGenerator { Future build({Config? config, FileWriter? writer}) async { config ??= loadPubspecConfigOrNull(pubspecFile, buildFile: buildFile); - if (config == null) return; + if (config == null) { + return; + } final flutter = config.pubspec.flutter; final flutterGen = config.pubspec.flutterGen; diff --git a/packages/core/lib/generators/assets_generator.dart b/packages/core/lib/generators/assets_generator.dart index a481d13cc..a426891f3 100644 --- a/packages/core/lib/generators/assets_generator.dart +++ b/packages/core/lib/generators/assets_generator.dart @@ -59,15 +59,23 @@ Future generateAssets( } final integrations = [ - ImageIntegration(config.packageParameterLiteral, - parseMetadata: config.flutterGen.parseMetadata), + ImageIntegration( + config.packageParameterLiteral, + parseMetadata: config.flutterGen.parseMetadata, + ), if (config.flutterGen.integrations.flutterSvg) - SvgIntegration(config.packageParameterLiteral, - parseMetadata: config.flutterGen.parseMetadata), + SvgIntegration( + config.packageParameterLiteral, + parseMetadata: config.flutterGen.parseMetadata, + ), if (config.flutterGen.integrations.rive) - RiveIntegration(config.packageParameterLiteral), + RiveIntegration( + config.packageParameterLiteral, + ), if (config.flutterGen.integrations.lottie) - LottieIntegration(config.packageParameterLiteral), + LottieIntegration( + config.packageParameterLiteral, + ), ]; // Warn for deprecated configs. @@ -198,13 +206,16 @@ List _getAssetRelativePathList( } final assetAbsolutePath = join(rootPath, tempAsset.path); if (FileSystemEntity.isDirectorySync(assetAbsolutePath)) { - assetRelativePathList.addAll(Directory(assetAbsolutePath) - .listSync() - .whereType() - .map( - (e) => tempAsset.copyWith(path: relative(e.path, from: rootPath)), - ) - .toList()); + assetRelativePathList.addAll( + Directory(assetAbsolutePath) + .listSync() + .whereType() + .map( + (file) => + tempAsset.copyWith(path: relative(file.path, from: rootPath)), + ) + .toList(), + ); } else if (FileSystemEntity.isFileSync(assetAbsolutePath)) { assetRelativePathList.add( tempAsset.copyWith(path: relative(assetAbsolutePath, from: rootPath)), @@ -376,15 +387,17 @@ Future _dotDelimiterStyleDefinition( // Add this directory reference to Assets class // if we are not under the default asset folder if (dirname(assetType.path) == '.') { - assetsStaticStatements.add(_Statement( - type: className, - filePath: assetType.posixStylePath, - name: assetType.baseName.camelCase(), - value: '$className()', - isConstConstructor: true, - isDirectory: true, - needDartDoc: true, - )); + assetsStaticStatements.add( + _Statement( + type: className, + filePath: assetType.posixStylePath, + name: assetType.baseName.camelCase(), + value: '$className()', + isConstConstructor: true, + isDirectory: true, + needDartDoc: true, + ), + ); } } @@ -470,10 +483,13 @@ String _flatStyleAssetsClassDefinition( List<_Statement> statements, String? packageName, ) { - final statementsBlock = - statements.map((statement) => '''${statement.toDartDocString()} + final statementsBlock = statements + .map( + (statement) => '''${statement.toDartDocString()} ${statement.toStaticFieldString()} - ''').join('\n'); + ''', + ) + .join('\n'); final valuesBlock = _assetValuesDefinition(statements, static: true); return _assetsClassDefinition( className, @@ -506,7 +522,9 @@ String _assetValuesDefinition( bool static = false, }) { final values = statements.where((element) => !element.isDirectory); - if (values.isEmpty) return ''; + if (values.isEmpty) { + return ''; + } final names = values.map((value) => value.name).join(', '); final type = values.every((element) => element.type == values.first.type) ? values.first.type diff --git a/packages/core/lib/generators/colors_generator.dart b/packages/core/lib/generators/colors_generator.dart index 1b2f09e4b..729fc1051 100644 --- a/packages/core/lib/generators/colors_generator.dart +++ b/packages/core/lib/generators/colors_generator.dart @@ -18,7 +18,8 @@ String generateColors( ) { if (colorsConfig.inputs.isEmpty) { throw const InvalidSettingsException( - 'The value of "flutter_gen/colors:" is incorrect.'); + 'The value of "flutter_gen/colors:" is incorrect.', + ); } final buffer = StringBuffer(); @@ -39,9 +40,10 @@ String generateColors( final data = colorFile.file.readAsStringSync(); if (colorFile.isXml) { colorList.addAll( - XmlDocument.parse(data).findAllElements('color').map((element) { - return _Color.fromXmlElement(element); - })); + XmlDocument.parse(data).findAllElements('color').map((element) { + return _Color.fromXmlElement(element); + }), + ); } else { throw 'Not supported file type ${colorFile.mime}.'; } diff --git a/packages/core/lib/generators/fonts_generator.dart b/packages/core/lib/generators/fonts_generator.dart index ee5204114..ec971809b 100644 --- a/packages/core/lib/generators/fonts_generator.dart +++ b/packages/core/lib/generators/fonts_generator.dart @@ -39,7 +39,8 @@ String generateFonts( final fontsConfig = config.flutterGen.fonts; if (fonts.isEmpty) { throw InvalidSettingsException( - 'The value of "flutter/fonts:" is incorrect.'); + 'The value of "flutter/fonts:" is incorrect.', + ); } final buffer = StringBuffer(); diff --git a/packages/core/lib/generators/generator_helper.dart b/packages/core/lib/generators/generator_helper.dart index b1f4d1274..1cb65a7f0 100644 --- a/packages/core/lib/generators/generator_helper.dart +++ b/packages/core/lib/generators/generator_helper.dart @@ -67,15 +67,17 @@ String sBuildDeprecation( '```yaml', 'flutter_gen:', ...migration, - '```' + '```', ]; final longestLineLength = lines - .map((line) => line - .split('\n') - .sorted((a, b) => b.length.compareTo(b.length)) - .first - .length) + .map( + (line) => line + .split('\n') + .sorted((a, b) => b.length.compareTo(b.length)) + .first + .length, + ) .sorted((a, b) => b.compareTo(a)) .first; diff --git a/packages/core/lib/generators/integrations/integration.dart b/packages/core/lib/generators/integrations/integration.dart index 563e31640..b3c0dcff3 100644 --- a/packages/core/lib/generators/integrations/integration.dart +++ b/packages/core/lib/generators/integrations/integration.dart @@ -55,8 +55,8 @@ const String deprecationMessagePackage = /// Currently only contains the width and height, but could contain more in /// future. class ImageMetadata { + const ImageMetadata(this.width, this.height); + final double width; final double height; - - const ImageMetadata(this.width, this.height); } diff --git a/packages/core/lib/settings/asset_type.dart b/packages/core/lib/settings/asset_type.dart index 0a4e316ff..872c96ba5 100644 --- a/packages/core/lib/settings/asset_type.dart +++ b/packages/core/lib/settings/asset_type.dart @@ -142,26 +142,32 @@ extension AssetTypeIterable on Iterable { String Function(String) style, { bool justBasename = false, }) { - List assets = map((e) => UniqueAssetType( - assetType: e, - style: style, - needExtension: false, - suffix: '', - basenameOnly: justBasename, - )).toList(); + List assets = map( + (e) => UniqueAssetType( + assetType: e, + style: style, + needExtension: false, + suffix: '', + basenameOnly: justBasename, + ), + ).toList(); while (true) { // Check if we have any name collisions. - final dups = assets.groupBy((e) => e.name).values; + final duplicates = assets.groupBy((e) => e.name).values; // No more duplicates, so we can bail. - if (dups.every((list) => list.length == 1)) break; + if (duplicates.every((list) => list.length == 1)) { + break; + } // Otherwise start to process the list and mutate the assets as needed. - assets = dups + assets = duplicates .map((list) { - assert(list.isNotEmpty, - 'The groupBy list of assets should not be empty.'); + assert( + list.isNotEmpty, + 'The groupBy list of assets should not be empty.', + ); // Check the first element in the list. Since we grouped by each // list element should have the same name. @@ -190,7 +196,9 @@ extension AssetTypeIterable on Iterable { list.forEachIndexed((asset, index) { // Shouldn't need to mutate the first item (unless it's an invalid // identifer). - if (index == 0 && isValidIdentifer) return; + if (index == 0 && isValidIdentifer) { + return; + } // Append a extra suffixes to each item so they hopefully become unique suffix = '${suffix}_'; @@ -203,8 +211,10 @@ extension AssetTypeIterable on Iterable { .toList(); } - assert(assets.map((e) => e.name).distinct().length == assets.length, - 'There are duplicate names in the asset list.'); + assert( + assets.map((e) => e.name).distinct().length == assets.length, + 'There are duplicate names in the asset list.', + ); return assets; } diff --git a/packages/core/lib/settings/import.dart b/packages/core/lib/settings/import.dart index bf236a05f..21f80bed3 100644 --- a/packages/core/lib/settings/import.dart +++ b/packages/core/lib/settings/import.dart @@ -9,7 +9,9 @@ class Import { @override bool operator ==(Object other) { - if (identical(this, other)) return true; + if (identical(this, other)) { + return true; + } return other is Import && identical(other.import, import) && identical(other.alias, alias); diff --git a/packages/core/lib/settings/pubspec.dart b/packages/core/lib/settings/pubspec.dart index acbbeff23..cd819ad15 100644 --- a/packages/core/lib/settings/pubspec.dart +++ b/packages/core/lib/settings/pubspec.dart @@ -31,23 +31,23 @@ class Flutter { required this.fonts, }); + factory Flutter.fromJson(Map json) => _$FlutterFromJson(json); + @JsonKey(name: 'assets', required: true) final List assets; @JsonKey(name: 'fonts', required: true) final List fonts; - - factory Flutter.fromJson(Map json) => _$FlutterFromJson(json); } @JsonSerializable(disallowUnrecognizedKeys: false) class FlutterFonts { const FlutterFonts({required this.family}); + factory FlutterFonts.fromJson(Map json) => _$FlutterFontsFromJson(json); + @JsonKey(name: 'family', required: true) final String family; - - factory FlutterFonts.fromJson(Map json) => _$FlutterFontsFromJson(json); } @JsonSerializable() @@ -62,6 +62,8 @@ class FlutterGen { required this.colors, }); + factory FlutterGen.fromJson(Map json) => _$FlutterGenFromJson(json); + @JsonKey(name: 'output', required: true) final String output; @@ -82,8 +84,6 @@ class FlutterGen { @JsonKey(name: 'colors', required: true) final FlutterGenColors colors; - - factory FlutterGen.fromJson(Map json) => _$FlutterGenFromJson(json); } @JsonSerializable() @@ -94,6 +94,9 @@ class FlutterGenColors { required this.outputs, }); + factory FlutterGenColors.fromJson(Map json) => + _$FlutterGenColorsFromJson(json); + @JsonKey(name: 'enabled', required: true) final bool enabled; @@ -102,9 +105,6 @@ class FlutterGenColors { @JsonKey(name: 'outputs', required: true) final FlutterGenElementOutputs outputs; - - factory FlutterGenColors.fromJson(Map json) => - _$FlutterGenColorsFromJson(json); } @JsonSerializable() @@ -117,6 +117,9 @@ class FlutterGenAssets { required this.exclude, }); + factory FlutterGenAssets.fromJson(Map json) => + _$FlutterGenAssetsFromJson(json); + @JsonKey(name: 'enabled', required: true) final bool enabled; @@ -133,9 +136,6 @@ class FlutterGenAssets { @JsonKey(name: 'exclude', required: true) final List exclude; - - factory FlutterGenAssets.fromJson(Map json) => - _$FlutterGenAssetsFromJson(json); } @JsonSerializable() @@ -145,13 +145,13 @@ class FlutterGenFonts { required this.outputs, }); + factory FlutterGenFonts.fromJson(Map json) => _$FlutterGenFontsFromJson(json); + @JsonKey(name: 'enabled', required: true) final bool enabled; @JsonKey(name: 'outputs', required: true) final FlutterGenElementFontsOutputs outputs; - - factory FlutterGenFonts.fromJson(Map json) => _$FlutterGenFontsFromJson(json); } @JsonSerializable() @@ -162,6 +162,9 @@ class FlutterGenIntegrations { required this.lottie, }); + factory FlutterGenIntegrations.fromJson(Map json) => + _$FlutterGenIntegrationsFromJson(json); + @JsonKey(name: 'flutter_svg', required: true) final bool flutterSvg; @@ -170,9 +173,6 @@ class FlutterGenIntegrations { @JsonKey(name: 'lottie', required: true) final bool lottie; - - factory FlutterGenIntegrations.fromJson(Map json) => - _$FlutterGenIntegrationsFromJson(json); } @JsonSerializable() @@ -181,11 +181,11 @@ class FlutterGenElementOutputs { required this.className, }); - @JsonKey(name: 'class_name', required: true) - final String className; - factory FlutterGenElementOutputs.fromJson(Map json) => _$FlutterGenElementOutputsFromJson(json); + + @JsonKey(name: 'class_name', required: true) + final String className; } enum FlutterGenElementAssetsOutputsStyle { @@ -217,6 +217,9 @@ class FlutterGenElementAssetsOutputs extends FlutterGenElementOutputs { required this.style, }) : super(className: className); + factory FlutterGenElementAssetsOutputs.fromJson(Map json) => + _$FlutterGenElementAssetsOutputsFromJson(json); + @JsonKey(name: 'package_parameter_enabled', defaultValue: false) final bool packageParameterEnabled; @@ -225,9 +228,6 @@ class FlutterGenElementAssetsOutputs extends FlutterGenElementOutputs { @JsonKey(name: 'style', required: true) final FlutterGenElementAssetsOutputsStyle style; - - factory FlutterGenElementAssetsOutputs.fromJson(Map json) => - _$FlutterGenElementAssetsOutputsFromJson(json); } @JsonSerializable() @@ -237,9 +237,9 @@ class FlutterGenElementFontsOutputs extends FlutterGenElementOutputs { required this.packageParameterEnabled, }); - @JsonKey(name: 'package_parameter_enabled', defaultValue: false) - final bool packageParameterEnabled; - factory FlutterGenElementFontsOutputs.fromJson(Map json) => _$FlutterGenElementFontsOutputsFromJson(json); + + @JsonKey(name: 'package_parameter_enabled', defaultValue: false) + final bool packageParameterEnabled; } diff --git a/packages/core/lib/utils/identifer.dart b/packages/core/lib/utils/identifer.dart index 86916c0fb..c99bf93f9 100644 --- a/packages/core/lib/utils/identifer.dart +++ b/packages/core/lib/utils/identifer.dart @@ -42,7 +42,7 @@ const builtinKeywords = { 'sealed', 'set', 'static', - 'typedef' + 'typedef', }; // 3. Limited reserved words. Can’t use as an identifier in any function body @@ -83,7 +83,7 @@ const reservedKeywords = { 'void', 'when', 'while', - 'with' + 'with', }; /// List of keywords that can't be used as identifiers. diff --git a/packages/core/lib/utils/map.dart b/packages/core/lib/utils/map.dart index 2be62c2b4..262d6b475 100644 --- a/packages/core/lib/utils/map.dart +++ b/packages/core/lib/utils/map.dart @@ -2,7 +2,11 @@ /// Exposes the [mergeMap] function, which... merges Maps. _copyValues( - Map from, Map to, bool recursive, bool acceptNull) { + Map from, + Map to, + bool recursive, + bool acceptNull, +) { for (final key in from.keys) { if (from[key] is Map && recursive) { if (to[key] is! Map) { @@ -10,7 +14,9 @@ _copyValues( } _copyValues(from[key] as Map, to[key] as Map, recursive, acceptNull); } else { - if (from[key] != null || acceptNull) to[key] = from[key] as V; + if (from[key] != null || acceptNull) { + to[key] = from[key] as V; + } } } } @@ -24,8 +30,11 @@ _copyValues( /// `acceptNull` is set to `false` by default. If set to `false`, /// then if the value on a map is `null`, it will be ignored, and /// that `null` will not be copied. -Map mergeMap(Iterable?> maps, - {bool recursive = true, bool acceptNull = false}) { +Map mergeMap( + Iterable?> maps, { + bool recursive = true, + bool acceptNull = false, +}) { final result = {}; // ignore: avoid_function_literals_in_foreach_calls maps.forEach((map) { diff --git a/packages/core/lib/utils/string.dart b/packages/core/lib/utils/string.dart index faa3d8cf9..164b9b8df 100644 --- a/packages/core/lib/utils/string.dart +++ b/packages/core/lib/utils/string.dart @@ -1,8 +1,10 @@ extension StringExt on String { String camelCase() { final words = _intoWords(this) - .map((w) => - '${w.substring(0, 1).toUpperCase()}${w.substring(1).toLowerCase()}') + .map( + (w) => '${w.substring(0, 1).toUpperCase()}' + '${w.substring(1).toLowerCase()}', + ) .toList(); words[0] = words[0].toLowerCase(); return words.join(); @@ -15,6 +17,7 @@ extension StringExt on String { } String camelCase(String s) => s.camelCase(); + String snakeCase(String s) => s.snakeCase(); List _intoWords(String path) { diff --git a/packages/core/test/assets_gen_test.dart b/packages/core/test/assets_gen_test.dart index 29ff06c42..e652dbcf6 100644 --- a/packages/core/test/assets_gen_test.dart +++ b/packages/core/test/assets_gen_test.dart @@ -65,10 +65,13 @@ void main() { lineEnding: '\n', ); - expect(() { - return generateAssets( - AssetsGenConfig.fromConfig(pubspec, config), formatter); - }, throwsA(isA())); + expect( + () => generateAssets( + AssetsGenConfig.fromConfig(pubspec, config), + formatter, + ), + throwsA(isA()), + ); }); test('Assets with package parameter enabled', () async { diff --git a/packages/core/test/colors_gen_test.dart b/packages/core/test/colors_gen_test.dart index 968f656dc..12f7d6e8f 100644 --- a/packages/core/test/colors_gen_test.dart +++ b/packages/core/test/colors_gen_test.dart @@ -28,10 +28,14 @@ void main() { lineEnding: '\n', ); - expect(() { - return generateColors( - pubspec, formatter, config.pubspec.flutterGen.colors); - }, throwsA(isA())); + expect( + () => generateColors( + pubspec, + formatter, + config.pubspec.flutterGen.colors, + ), + throwsA(isA()), + ); }); test('Wrong colors settings on pubspec.yaml', () async { @@ -43,10 +47,16 @@ void main() { lineEnding: '\n', ); - expect(() { - return generateColors( - pubspec, formatter, config.pubspec.flutterGen.colors); - }, throwsA(isA())); + expect( + () { + return generateColors( + pubspec, + formatter, + config.pubspec.flutterGen.colors, + ); + }, + throwsA(isA()), + ); }); test('ColorPath Tests', () async { diff --git a/packages/core/test/flutter_gen_test.dart b/packages/core/test/flutter_gen_test.dart index a940d5434..e28b3e0db 100644 --- a/packages/core/test/flutter_gen_test.dart +++ b/packages/core/test/flutter_gen_test.dart @@ -173,9 +173,10 @@ void main() { test('Wrong lineLength', () async { const pubspec = 'test_resources/pubspec_wrong_line_length.yaml'; - expect(() { - return FlutterGenerator(File(pubspec)).build(); - }, throwsA(isA())); + expect( + () => FlutterGenerator(File(pubspec)).build(), + throwsA(isA()), + ); }); test('Disabled generation', () async { diff --git a/packages/core/test/fonts_gen_test.dart b/packages/core/test/fonts_gen_test.dart index cd399a023..981596606 100644 --- a/packages/core/test/fonts_gen_test.dart +++ b/packages/core/test/fonts_gen_test.dart @@ -28,9 +28,10 @@ void main() { lineEnding: '\n', ); - expect(() { - return generateFonts(FontsGenConfig.fromConfig(config), formatter); - }, throwsA(isA())); + expect( + () => generateFonts(FontsGenConfig.fromConfig(config), formatter), + throwsA(isA()), + ); }); test('Change the class name', () async { diff --git a/packages/core/test/gen_test_helper.dart b/packages/core/test/gen_test_helper.dart index 4c6b45555..3f7811430 100644 --- a/packages/core/test/gen_test_helper.dart +++ b/packages/core/test/gen_test_helper.dart @@ -23,7 +23,9 @@ Future> runAssetsGen( final pubspecFile = File(pubspec); File? buildFile; - if (build != null) buildFile = File(build); + if (build != null) { + buildFile = File(build); + } await FlutterGenerator( pubspecFile, diff --git a/packages/runner/lib/flutter_gen_runner.dart b/packages/runner/lib/flutter_gen_runner.dart index ace44a0cb..65ab8fb50 100644 --- a/packages/runner/lib/flutter_gen_runner.dart +++ b/packages/runner/lib/flutter_gen_runner.dart @@ -34,9 +34,13 @@ class FlutterGenBuilder extends Builder { @override Future build(BuildStep buildStep) async { - if (_config == null) return; + if (_config == null) { + return; + } final state = await _createState(_config!, buildStep); - if (state.shouldSkipGenerate(_currentState)) return; + if (state.shouldSkipGenerate(_currentState)) { + return; + } _currentState = state; await generator.build( @@ -49,16 +53,18 @@ class FlutterGenBuilder extends Builder { @override Map> get buildExtensions { - if (_config == null) return {}; - final ouput = _config!.pubspec.flutterGen.output; + if (_config == null) { + return {}; + } + final output = _config!.pubspec.flutterGen.output; return { r'$package$': [ for (final name in [ generator.assetsName, generator.colorsName, - generator.fontsName + generator.fontsName, ]) - join(ouput, name), + join(output, name), ], }; } @@ -100,7 +106,9 @@ class FlutterGenBuilder extends Builder { final HashMap colors = HashMap(); if (pubspec.flutterGen.colors.enabled) { for (final colorInput in pubspec.flutterGen.colors.inputs) { - if (colorInput.isEmpty) continue; + if (colorInput.isEmpty) { + continue; + } await for (final assetId in buildStep.findAssets(Glob(colorInput))) { final digest = await buildStep.digest(assetId); colors[assetId.path] = digest; @@ -133,7 +141,9 @@ class _FlutterGenBuilderState { final HashMap colors; bool shouldSkipGenerate(_FlutterGenBuilderState? previous) { - if (previous == null) return false; + if (previous == null) { + return false; + } return pubspecDigest == previous.pubspecDigest && const SetEquality().equals(assets, previous.assets) && const MapEquality().equals(colors, previous.colors);