diff --git a/lib/src/settings/flutter.dart b/lib/src/settings/flutter.dart index eca40c85..2e5692bf 100644 --- a/lib/src/settings/flutter.dart +++ b/lib/src/settings/flutter.dart @@ -4,8 +4,12 @@ import 'package:yaml/yaml.dart'; class Flutter { Flutter(YamlMap flutterMap) { if (flutterMap != null) { - assets = FlutterAssets(safeCast(flutterMap['assets'])); - fonts = FlutterFonts(safeCast(flutterMap['fonts'])); + if (flutterMap.containsKey('assets')) { + assets = FlutterAssets(safeCast(flutterMap['assets'])); + } + if (flutterMap.containsKey('fonts')) { + fonts = FlutterFonts(safeCast(flutterMap['fonts'])); + } } } diff --git a/lib/src/settings/flutter_gen.dart b/lib/src/settings/flutter_gen.dart index 974ed30a..016a9266 100644 --- a/lib/src/settings/flutter_gen.dart +++ b/lib/src/settings/flutter_gen.dart @@ -8,10 +8,14 @@ class FlutterGen { FlutterGen(YamlMap flutterGenMap) { if (flutterGenMap != null) { _output = safeCast(flutterGenMap['output']); - integrations = FlutterGenIntegrations( + if (flutterGenMap.containsKey('integrations')) { + integrations = FlutterGenIntegrations( safeCast(flutterGenMap['integrations'])); + } _lineLength = safeCast(flutterGenMap['lineLength']); - colors = FlutterGenColors(safeCast(flutterGenMap['colors'])); + if (flutterGenMap.containsKey('colors')) { + colors = FlutterGenColors(safeCast(flutterGenMap['colors'])); + } } }