flutter_fixer library
Library entry for tests and programmatic use.
Classes
- AnalyzeRunResult
- AnalyzeSummary
-
Result of parsing
dart analyze --format=jsonoutput. - 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 --codediagnostic 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.yamlfromrootand checks for Flutter dependency. -
buildDartFixArgs(
{required bool dryRun, required List< String> codes}) → List<String> -
Builds the argument list after
dartfordart 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
pubspecYamldeclares 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=jsoninworkingDirectory. -
runDartFix(
{required Directory workingDirectory, required bool dryRun, required List< String> codes}) → Future<ProcessResult> -
Runs
dart fixinworkingDirectory. -
runInteractiveWizardIfTty(
) → Future< bool> - Runs step-by-step prompts when no CLI subcommand is used.