@@ -9,7 +9,7 @@ import 'package:path/path.dart';
99import 'package:yaml/yaml.dart' ;
1010
1111class Config {
12- Config ._({required this .pubspec, required this .pubspecFile});
12+ const Config ._({required this .pubspec, required this .pubspecFile});
1313
1414 final Pubspec pubspec;
1515 final File pubspecFile;
@@ -19,9 +19,6 @@ Config loadPubspecConfig(File pubspecFile, {File? buildFile}) {
1919 final pubspecLocaleHint = normalize (
2020 join (basename (pubspecFile.parent.path), basename (pubspecFile.path)),
2121 );
22- final buildLocaleHint = buildFile != null && buildFile.existsSync ()
23- ? join (basename (buildFile.parent.path), basename (buildFile.path))
24- : '' ;
2522
2623 stdout.writeln (
2724 '$flutterGenVersion Loading ...' ,
@@ -40,11 +37,15 @@ Config loadPubspecConfig(File pubspecFile, {File? buildFile}) {
4037 if (buildFile != null && buildFile.existsSync ()) {
4138 final buildContent = buildFile.readAsStringSync ();
4239 final rawMap = loadYaml (buildContent) as Map ? ;
43- final optionBuildMap = rawMap? ['targets' ]? [r'$default' ]? ['builders' ]? ['flutter_gen' ]? ['options' ];
40+ final optionBuildMap = rawMap? ['targets' ]? [r'$default' ]? ['builders' ]
41+ ? ['flutter_gen' ]? ['options' ];
4442
4543 if (optionBuildMap != null ) {
4644 final buildMap = {'flutter_gen' : optionBuildMap};
4745 mergedMap = mergeMap ([mergedMap, buildMap]);
46+ final buildLocaleHint = normalize (
47+ join (basename (buildFile.parent.path), basename (buildFile.path)),
48+ );
4849 stdout.writeln (
4950 'Reading FlutterGen options from $buildLocaleHint ' ,
5051 );
0 commit comments