@@ -316,19 +316,19 @@ Future<String> _dotDelimiterStyleDefinition(
316316 List <Integration > integrations,
317317) async {
318318 final rootPath = Directory (config.rootPath).absolute.uri.toFilePath ();
319- final buffer = StringBuffer ( );
320- final className = config.flutterGen.assets.outputs.className ;
319+ final packageName = generatePackageNameForConfig (config );
320+ final outputs = config.flutterGen.assets.outputs;
321321 final assetRelativePathList = _getAssetRelativePathList (
322322 rootPath,
323323 config.assets,
324324 config.exclude,
325325 );
326- final assetsStaticStatements = < _Statement > [];
327-
328326 final assetTypeQueue = ListQueue <AssetType >.from (
329327 _constructAssetTree (assetRelativePathList, rootPath).children,
330328 );
331329
330+ final assetsStaticStatements = < _Statement > [];
331+ final buffer = StringBuffer ();
332332 while (assetTypeQueue.isNotEmpty) {
333333 final assetType = assetTypeQueue.removeFirst ();
334334 String assetPath = join (rootPath, assetType.path);
@@ -346,13 +346,7 @@ Future<String> _dotDelimiterStyleDefinition(
346346 final List <_Statement ?> results = await Future .wait (
347347 assetType.children
348348 .mapToUniqueAssetType (camelCase, justBasename: true )
349- .map (
350- (e) => _createAssetTypeStatement (
351- config,
352- e,
353- integrations,
354- ),
355- ),
349+ .map ((e) => _createAssetTypeStatement (config, e, integrations)),
356350 );
357351 final statements = results.whereType <_Statement >().toList ();
358352
@@ -368,14 +362,15 @@ Future<String> _dotDelimiterStyleDefinition(
368362 assetsStaticStatements.add (statement! );
369363 } else {
370364 final className = '\$ ${assetType .path .camelCase ().capitalize ()}Gen' ;
365+ String ? directoryPath;
366+ if (outputs.directoryPathEnabled) {
367+ directoryPath = assetType.posixStylePath;
368+ if (packageName != null ) {
369+ directoryPath = 'packages/$packageName /$directoryPath ' ;
370+ }
371+ }
371372 buffer.writeln (
372- _directoryClassGenDefinition (
373- className,
374- statements,
375- config.flutterGen.assets.outputs.directoryPathEnabled
376- ? assetType.posixStylePath
377- : null ,
378- ),
373+ _directoryClassGenDefinition (className, statements, directoryPath),
379374 );
380375 // Add this directory reference to Assets class
381376 // if we are not under the default asset folder
@@ -395,10 +390,9 @@ Future<String> _dotDelimiterStyleDefinition(
395390 assetTypeQueue.addAll (assetType.children);
396391 }
397392 }
398- final String ? packageName = generatePackageNameForConfig (config);
399393 buffer.writeln (
400394 _dotDelimiterStyleAssetsClassDefinition (
401- className,
395+ outputs. className,
402396 assetsStaticStatements,
403397 packageName,
404398 ),
0 commit comments