Skip to content

Release v1.0.0

Choose a tag to compare

@SriNKast SriNKast released this 07 Jul 20:29
· 4 commits to main since this release

First stable release of amount_localizer — a locale-aware amount formatter for Flutter with a native bridge that reads the device's true Region setting.

Why

Flutter's PlatformDispatcher.instance.locale only exposes the language locale. On an English-language iPhone with Region = Brazil, Dart sees en_US, but the numeric keyboard emits , for the decimal. Users in that setup can't type an amount because the display formats with . but the keyboard produces ,. This plugin closes that gap.

What's inside

  • AmountInputLocale — canonical enum of numeric formats (1,234.56 / 1.234,56 / 1 234,56 / Indian lakhs / …) with country and Locale resolvers.
  • AmountLocalizer — cached intl-backed formatter with banking defaults and a .localizedAmount extension on Object.
  • DeviceRegionService — one call at app startup that reads the device region over a MethodChannel and applies it to AmountInputLocale.regionOverride.

Platforms

  • iOS 12+ — reads Locale.current.region (iOS 16+) / regionCode (older).
  • Android 21+ — reads Locale.getDefault(Locale.Category.FORMAT).country.

Stability

First stable release. No API changes vs 0.1.1 — the public surface is now covered by semver, so any breaking change from here on will require a 2.0.0.

Install

dependencies:
  amount_localizer: ^1.0.0