flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

[BUG]: Error to generate assets

Open Mairramer opened this issue 4 months ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Version

5.11.0

Command type

build_runner (Default)

What happened?

When I set the output parameter, the class is not generated correctly. Expected: SDSAssets.icons.iconeArrowDown Actual: SDSAssets.iconsIconeArrowDown Without the output parameter, it generates correctly as Assets.icons.iconeCirclePause

Expected:

class $AssetsIconsGen {
  const $AssetsIconsGen();

  /// File path: assets/icons/icone-arrow-down.svg
  SvgGenImage get iconeArrowDown => const SvgGenImage('assets/icons/icone-arrow-down.svg');
...
class SDSAssets {
  const SDSAssets._();

  static const String package = 'design_system_pkg';

  static const $AssetsIconsGen icons = $AssetsIconsGen();
  static const $AssetsLogosGen logos = $AssetsLogosGen();
}

Actual:

class SDSAssets {
  const SDSAssets._();

  static const String package = 'design_system_pkg';

  /// File path: assets/icons/icone-arrow-down.svg
  static const SvgGenImage iconsIconeArrowDown = SvgGenImage('assets/icons/icone-arrow-down.svg');

Relevant a pubspec.yaml.

flutter_gen:
  output: lib/gen/
  line_length: 120
  integrations:
    flutter_svg: true
  assets:
    outputs:
      package_parameter_enabled: true
      style: camel-case
      class_name: SDSAssets
  fonts:
    enabled: true

flutter:
  uses-material-design: true

  assets:
    - assets/icons/
    - assets/logos/

Relevant log output


Code of Conduct

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

Mairramer avatar Sep 03 '25 17:09 Mairramer

It's actually because I was using style: camel-case, but that wasn't the case before. Maybe a regression?

Mairramer avatar Sep 03 '25 17:09 Mairramer

@Mairramer Could you setup a minimal repo so I can investigate?

AlexV525 avatar Sep 21 '25 11:09 AlexV525