humazed / locale_observer

Utility for detecting when the system tells the app that the user's locale has changed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

locale_observer

pub package

Utility for detecting when the system tells the app that the user's locale has.

Getting Started

Should be above MaterialApp or CupertinoApp in the widget tree If you want to observe changes as soon as the app open and to continue to do so as log as the app is alive.

LocaleObserver(
  didChangeLocales: (BuildContext context, List<Locale> locales) {
    print("locales = $locales");
  },
  child: MaterialApp(
    home: HomePage(),
  ),
);

About

Utility for detecting when the system tells the app that the user's locale has changed.

License:Other


Languages

Language:Dart 41.3%Language:Kotlin 28.6%Language:Swift 10.9%Language:Ruby 10.5%Language:Objective-C 8.6%