Skip to content

[FR]: Add package name to directory path #602

@EndersonPro

Description

@EndersonPro

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

I'm generating assets from an internal package for an application, and I need to access the path of the folder where the assets are and I have enabled the directory_path_enabled flag, however I also have the package_parameter_enabled flag active. So I expected the asset path to also have the path.

Is that possible?

Describe the solution

flutter_gen:
  output: lib/generated/
  line_length: 80
  assets:
    outputs:
      directory_path_enabled: true
      package_parameter_enabled: true

Current result:

class $AssetsI18nGen {
  const $AssetsI18nGen();

  /// Directory path: assets/i18n
  String get path => 'assets/i18n';
}

Expected result:

class $AssetsI18nGen {
  const $AssetsI18nGen();

  /// Directory path: packages/my_package/assets/i18n
  String get path => 'packages/my_package/assets/i18n';
}

Additional context

Assets config:

flutter:
  assets:
    - assets/i18n/

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions