@@ -59,15 +59,23 @@ Future<String> generateAssets(
5959 }
6060
6161 final integrations = < Integration > [
62- ImageIntegration (config.packageParameterLiteral,
63- parseMetadata: config.flutterGen.parseMetadata),
62+ ImageIntegration (
63+ config.packageParameterLiteral,
64+ parseMetadata: config.flutterGen.parseMetadata,
65+ ),
6466 if (config.flutterGen.integrations.flutterSvg)
65- SvgIntegration (config.packageParameterLiteral,
66- parseMetadata: config.flutterGen.parseMetadata),
67+ SvgIntegration (
68+ config.packageParameterLiteral,
69+ parseMetadata: config.flutterGen.parseMetadata,
70+ ),
6771 if (config.flutterGen.integrations.rive)
68- RiveIntegration (config.packageParameterLiteral),
72+ RiveIntegration (
73+ config.packageParameterLiteral,
74+ ),
6975 if (config.flutterGen.integrations.lottie)
70- LottieIntegration (config.packageParameterLiteral),
76+ LottieIntegration (
77+ config.packageParameterLiteral,
78+ ),
7179 ];
7280
7381 // Warn for deprecated configs.
@@ -198,13 +206,16 @@ List<FlavoredAsset> _getAssetRelativePathList(
198206 }
199207 final assetAbsolutePath = join (rootPath, tempAsset.path);
200208 if (FileSystemEntity .isDirectorySync (assetAbsolutePath)) {
201- assetRelativePathList.addAll (Directory (assetAbsolutePath)
202- .listSync ()
203- .whereType <File >()
204- .map (
205- (e) => tempAsset.copyWith (path: relative (e.path, from: rootPath)),
206- )
207- .toList ());
209+ assetRelativePathList.addAll (
210+ Directory (assetAbsolutePath)
211+ .listSync ()
212+ .whereType <File >()
213+ .map (
214+ (file) =>
215+ tempAsset.copyWith (path: relative (file.path, from: rootPath)),
216+ )
217+ .toList (),
218+ );
208219 } else if (FileSystemEntity .isFileSync (assetAbsolutePath)) {
209220 assetRelativePathList.add (
210221 tempAsset.copyWith (path: relative (assetAbsolutePath, from: rootPath)),
@@ -376,15 +387,17 @@ Future<String> _dotDelimiterStyleDefinition(
376387 // Add this directory reference to Assets class
377388 // if we are not under the default asset folder
378389 if (dirname (assetType.path) == '.' ) {
379- assetsStaticStatements.add (_Statement (
380- type: className,
381- filePath: assetType.posixStylePath,
382- name: assetType.baseName.camelCase (),
383- value: '$className ()' ,
384- isConstConstructor: true ,
385- isDirectory: true ,
386- needDartDoc: true ,
387- ));
390+ assetsStaticStatements.add (
391+ _Statement (
392+ type: className,
393+ filePath: assetType.posixStylePath,
394+ name: assetType.baseName.camelCase (),
395+ value: '$className ()' ,
396+ isConstConstructor: true ,
397+ isDirectory: true ,
398+ needDartDoc: true ,
399+ ),
400+ );
388401 }
389402 }
390403
@@ -470,10 +483,13 @@ String _flatStyleAssetsClassDefinition(
470483 List <_Statement > statements,
471484 String ? packageName,
472485) {
473- final statementsBlock =
474- statements.map ((statement) => '''${statement .toDartDocString ()}
486+ final statementsBlock = statements
487+ .map (
488+ (statement) => '''${statement .toDartDocString ()}
475489 ${statement .toStaticFieldString ()}
476- ''' ).join ('\n ' );
490+ ''' ,
491+ )
492+ .join ('\n ' );
477493 final valuesBlock = _assetValuesDefinition (statements, static : true );
478494 return _assetsClassDefinition (
479495 className,
@@ -506,7 +522,9 @@ String _assetValuesDefinition(
506522 bool static = false ,
507523}) {
508524 final values = statements.where ((element) => ! element.isDirectory);
509- if (values.isEmpty) return '' ;
525+ if (values.isEmpty) {
526+ return '' ;
527+ }
510528 final names = values.map ((value) => value.name).join (', ' );
511529 final type = values.every ((element) => element.type == values.first.type)
512530 ? values.first.type
0 commit comments