locale_sweep library

Localization release QA for Flutter.

Runs app flows across every locale, viewport size, text scale, and RTL mode, then reports broken screens with screenshot proof.

Classes

ArbAnalyzer
Static analyzer for ARB (Application Resource Bundle) translation files.
ArbIssue
A single issue found during ARB analysis.
ArbReport
Result of an ARB analysis containing all detected issues.
DiffResult
Result of comparing two golden screenshots pixel-by-pixel.
GoldenDiffer
Computes pixel-level diffs between golden screenshots and generates side-by-side comparison images.
OverflowDetector
Intercepts FlutterError.onError to capture RenderFlex overflow errors.
OverflowError
A captured RenderFlex overflow error with optional pixel count.
ParsedReport
ReportGenerator
Generates Markdown and JSON reports from sweep results.
SweepConfig
Configuration for a sweep run, loadable from locale_sweep.yaml.
SweepGoldenComparator
A golden file comparator that computes pixel diffs and applies tolerance.
SweepResult
The result of running a single sweep variant.
SweepRunSummary
Aggregates SweepResults with summary statistics.
SweepVariant
A single combination of locale, text scale, viewport, and brightness to test.
ViewportPreset
A named viewport size used to simulate layout dimensions in tests.

Enums

ArbIssueType
The type of issue found during ARB analysis.

Constants

sweepResultsDir → const String
Default directory where sweep results are written for CLI consumption.

Properties

sweepResults List<SweepResult>
Returns all results recorded by sweepTest in this test isolate.
no setter

Functions

clearSweepResults() → void
Clears all recorded sweep results.
discoverPackages(String root, {String testDir = 'test/sweep'}) List<String>
loadResults(SweepConfig cfg, {String resultsPath = '.locale_sweep/results'}) ParsedReport?
mergeResults(List<SweepResult> results) ParsedReport
parseFlowFromName(String testName) String
parseLocale(String code) Locale
Parses a BCP-47 locale string into a Locale.
parseMachineOutput(String output, SweepConfig cfg) ParsedReport
parseVariantFromName(String testName, SweepConfig cfg) SweepVariant
shouldFail(ParsedReport report, Set<String> failOn) bool
sweepTest(String flowName, {required Widget builder(), SweepBody? body, SweepVariantBody? variantBody, SweepConfig? config, List<String>? locales, List<double>? textScales, List<ViewportPreset>? viewports, bool? darkMode, ThemeData? lightTheme, ThemeData? darkTheme, String? arbDir, String? baseLocale, bool captureScreenshots = true, String screenshotDir = '.locale_sweep/screenshots', bool skip(SweepVariant variant)?, double? tolerance, String diffOutputDir = '.locale_sweep/diffs', Future<void> setUp()?, List<LocalizationsDelegate>? localizationsDelegates}) → void
Generates locales × textScales × viewports (× brightness) test cases for flowName.

Typedefs

SweepBody = Future<void> Function(WidgetTester tester)
Callback for interactions to run after the widget is pumped.
SweepVariantBody = Future<void> Function(WidgetTester tester, SweepVariant variant)
Callback that also receives the current SweepVariant for locale-aware interactions.