File tree 1 file changed +26
-26
lines changed
1 file changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -34,39 +34,39 @@ class FlutterGenBuilder extends Builder {
34
34
35
35
@override
36
36
Future <void > build (BuildStep buildStep) async {
37
- if (_config == null ) {
38
- return ;
39
- }
40
- final state = await _createState (_config, buildStep);
41
- if (state.shouldSkipGenerate (_currentState)) {
42
- return ;
37
+ if (_config case final config? ) {
38
+ final state = await _createState (config, buildStep);
39
+ if (state.shouldSkipGenerate (_currentState)) {
40
+ return ;
41
+ }
42
+ _currentState = state;
43
+
44
+ await generator.build (
45
+ config: config,
46
+ writer: (contents, path) {
47
+ buildStep.writeAsString (_output (buildStep, path), contents);
48
+ },
49
+ );
43
50
}
44
- _currentState = state;
45
-
46
- await generator.build (
47
- config: _config,
48
- writer: (contents, path) {
49
- buildStep.writeAsString (_output (buildStep, path), contents);
50
- },
51
- );
52
51
}
53
52
54
53
@override
55
54
Map <String , List <String >> get buildExtensions {
56
- if (_config == null ) {
55
+ if (_config case final config? ) {
56
+ final output = config.pubspec.flutterGen.output;
57
+ return {
58
+ r'$package$' : [
59
+ for (final name in [
60
+ generator.assetsName,
61
+ generator.colorsName,
62
+ generator.fontsName,
63
+ ])
64
+ join (output, name),
65
+ ],
66
+ };
67
+ } else {
57
68
return {};
58
69
}
59
- final output = _config.pubspec.flutterGen.output;
60
- return {
61
- r'$package$' : [
62
- for (final name in [
63
- generator.assetsName,
64
- generator.colorsName,
65
- generator.fontsName,
66
- ])
67
- join (output, name),
68
- ],
69
- };
70
70
}
71
71
72
72
Future <_FlutterGenBuilderState > _createState (
You can’t perform that action at this time.
0 commit comments