flutter_fixer library

Library entry for tests and programmatic use.

Classes

AnalyzeRunResult
AnalyzeSummary
Result of parsing dart analyze --format=json output.
WizardMessages
Localized strings for the interactive wizard (default: English).

Enums

WizardLocale
Interactive wizard UI language.

Constants

fixPresets → const Map<String, List<String>>
Maps user-facing fix categories to dart fix --code diagnostic codes.
presetKeyAll → const String
Sentinel preset: full whitelist (allWhitelistedFixCodes).
presetMenuOrder → const List<String>
Order for CLI flags and interactive menu (stable UX). presetKeyAll is first — default choice in the wizard (Enter = 1).

Functions

allWhitelistedFixCodes() List<String>
Every diagnostic code this package may pass to dart fix --code.
assertFlutterProject(Directory root) → void
Loads pubspec.yaml from root and checks for Flutter dependency.
buildDartFixArgs({required bool dryRun, required List<String> codes}) List<String>
Builds the argument list after dart for dart fix.
codesForPresets(Iterable<String> presetKeys) List<String>
findPackageRoot([String? start]) Directory?
Resolves the Dart/Flutter package root containing pubspec.yaml.
isFlutterProject(String pubspecYaml) bool
Returns true if pubspecYaml declares a dependency on the Flutter SDK.
parseAnalyzeJson(String stdout) AnalyzeSummary
Parses a single JSON object line or full JSON from dart analyze.
presetMenuLine(int oneBasedIndex, String key) String
One-line description for the interactive menu (option oneBasedIndex).
printAnalyzeSummary(AnalyzeSummary s, IOSink out) → void
runDartAnalyze(Directory workingDirectory) Future<AnalyzeRunResult>
Runs dart analyze --format=json in workingDirectory.
runDartFix({required Directory workingDirectory, required bool dryRun, required List<String> codes}) Future<ProcessResult>
Runs dart fix in workingDirectory.
runInteractiveWizardIfTty() Future<bool>
Runs step-by-step prompts when no CLI subcommand is used.