KarimHachicha
KarimHachicha

Reputation: 181

Fixing infos error in Flutter project with a command

I have a Flutter project with some Infos(less than warnings) in my console in vsCode.

Like : remove unused imports ..

I got a ton of them after months of work. Is there a way to fix them all with a simple command or any tool ?

Thank you.

Upvotes: 1

Views: 2190

Answers (1)

DEFL
DEFL

Reputation: 1052

You can use

dart fix --apply

The dart fix command finds and fixes two types of issues:

Analysis issues identified by dart analyze that have associated automated fixes (sometimes called quick-fixes or code actions)

Outdated API usages when updating to newer releases of the Dart and Flutter SDKs.

See this doc: https://dart.dev/tools/dart-fix

Upvotes: 2

Related Questions