Skip to content

flutter create should suggest replacing "-" with "_" if doing so would yield a valid Dart package name #109775

@bryanoltman

Description

@bryanoltman

Use case

I often try to use flutter create to spin up a quick example. The number of times I use - instead of _ is astounding, and the error text doesn't make it especially clear that this is why my package name is invalid ("my-flutter-exampe" is not a valid Dart package name.).

Proposal

It would be super helpful if the error message called this out, as I imagine 1) a lot of people make this mistake and 2) it's not immediately obvious to them that the - vs _ distinction is the cause of the problem. The tool could also suggest a valid package name if swapping the separator character with _ would yield a valid package name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: first hourThe first hour of using Flutterc: proposalA detailed proposal for a change to Fluttergood first issueRelatively approachable for first-time contributorsteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions