Skip to content

bug: Generated code contains throw throw in flavor switch default case #20

Description

@martyfuhry

Description

The generated fromString switch statement produces throw throw Exception('Invalid flavor') instead of throw Exception('Invalid flavor'). The duplicate throw is a bug in the mustache template at lib/src/utility/src/dart_configuration_generator.dart:74.

Steps to reproduce

  1. Add two or more flavors to dart_define.yaml
  2. Run dart_define generate
  3. Inspect the generated .g.dart file: the FlavorExtension.fromString
    default case contains throw throw Exception('Invalid flavor')

Free word

No response

Platform

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions