sway 0.3.1
sway: ^0.3.1 copied to clipboard
Type-safe Flutter localization with an instant in-app locale switcher and zero-friction migration from ARB, easy_localization, and slang.
Changelog #
All notable changes to this project will be documented in this file.
0.3.1 - 2026-09-29 #
Changed #
- Release builds (
enableInRelease: true) mark the bubble with a red ring instead of theSWAY ACTIVEtext tag, plus a "Sway active in release build" screen-reader label. The locale badge (EN, AR, …) is drawn above the ring so it stays readable. - Bubble keeps a 12px gap from every edge inside the safe area (status bar, navigation bar, notches). Dragging is limited to that area too.
- Example app enables Sway in release builds to show the red ring.
Fixed #
- Bubble sometimes started in the top-left corner when the first frame reported a 0×0 screen; it now waits for the real size.
0.3.0 - 2026-09-28 #
Added #
enabledandenableInReleaseonSwayOverlayandSway.debugOverlay, matching Mole and Ferret so one app flag can drive all three packages.- Release builds can now run the overlay when
enableInRelease: true. A redSWAY ACTIVEtag sits above the bubble and a console banner prints once.
Changed #
- The floating button now parks in the lower-middle band by default.
Deprecated #
disabledonSwayOverlay/Sway.debugOverlay. Useenabled: false.SwayOverlay.disabled(...)is still supported.
0.2.0 - 2026-09-10 #
Added #
Sway.debugOverlay- nested Overlay host forMaterialApp.builder(no app-owned host).ListenableLocaleAdapter- bridge GetIt / ChangeNotifier / ValueNotifier locale owners.debugOnlyonSwayOverlay/Sway.debugOverlay- gate onkDebugMode(profile can hide the bubble).- Long-press the floating button to hide it until hot reload / hot restart.
- Tap opens the locale panel immediately (no double-tap delay).
- Bubble edge position remembered across hot reload (process-local).
- Overlay-only docs rewritten for Stateless + builder as the production default.
Changed #
- Overlay-only is the supported production path in 0.2.x; full ARB → Sway JSON remains early.
0.1.0 - 2026-09-09 #
Added #
- Format module: JSON locale parser, cross-locale validator, CLDR plural rules, RTL table.
- Codegen CLI (
dart run sway:codegen): nested type-safe Dart,resolvePlural, multi-file output (sway.g.dart+sway_<locale>.g.dart). SwayScope+context.t/context.sway/SwayTranslations.of(context)/forLocale.sway.config.jsonforbaseLocale,localeDir,outputFile,fallbackStrategy.- Overlay: edge-snapping bubble, Force RTL/LTR, locale search when >8 locales, adapter sync, release gating.
- Adapters:
SwayFormatAdapter,IntlAdapter,EasyLocalizationAdapter,ManualAdapter. - Migration CLI (
dart run sway:migrate) for ARB, easy_localization (JSON), and slang. - Example app with six locales and docs under
doc/. - Overlay-only path documented for ARB / easy_localization / slang (
doc/OVERLAY_ONLY.md).
Fixed #
- ARB migrate maps ICU exact plurals
=0/=1/=2→zero/one/twoso codegen accepts the output.
Known limitations #
- No
build_runnerBuilder yet (CLI codegen only). - easy_localization YAML/CSV migrate requires JSON first (no extra deps).
- Filesystem tooling lives in
package:sway/codegen.dart(CLI / VM); app import ispackage:sway/sway.dart.
