Breaking changes
-
Removed
DeviceRegionService. Init is now a single call on the headline class:// Before (1.x) await DeviceRegionService.initializeAndApply(); // After (2.0) await AmountLocalizer.ensureInitialized();
-
Removed the top-level
DeviceRegionServiceexport from the public barrel. The platform bridge is now a library-private implementation detail. -
Tests can reach the underlying
MethodChannelvia@visibleForTesting AmountLocalizer.debugChannel.
Migration
Replace every DeviceRegionService.initializeAndApply() callsite with AmountLocalizer.ensureInitialized(). Same semantics, same return type (Future<String?>), same best-effort / never-throws contract.
Install
dependencies:
amount_localizer: ^2.0.0📦 pub.dev: https://pub.dev/packages/amount_localizer/versions/2.0.0