Skip to content

Hide all warnings from Dart compilers when running Flutter. #103994

@jacob314

Description

@jacob314

Use case

Flutter developers see many suprious warnings from the Dart compilers both when they run and compile their Dart applications.
Users see warnings from outside their package and see warnings from their own package even when using the comment syntax to suppress the warnings. These warnings are distracting and not actionable.
See dart-lang/sdk#46264 for more context.

Proposal

Add the --verbosity=error flag to all commands running Dart compilers
This eliminates showing all warnings in compiler output for Flutter eliminating the problem.

Most Dart warnings for dependencies are not actionable as users should not take any action to resolve the warning and the warnings are harmless. Users who want to see warnings and lints can use the flutter analyze command or use the functionality embedded in their IDE. This isn't the perfect solution but is the most practical short term step to resolve a pain point for users.
Alternative solutions would be significantly more costly to implement with limited benefit. Alternatives include making the Dart compilers support the same rules for filtering warning as the analyzer (including only showing warnings for the local project), enabling automatically running dart fix to resolve warnings from dependencies, and integrating the analyzer with the compiler to emit warnings consistently.

Fyi @christopherfujino.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: proposalA detailed proposal for a change to Flutterdependency: dartDart team may need to help usteam-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