lang_env 1.0.0 copy "lang_env: ^1.0.0" to clipboard
lang_env: ^1.0.0 copied to clipboard

A Flutter utility package for retrieving device and application locale information using official Flutter APIs.

lang_env #

A Flutter utility package for retrieving device and application locale information using official Flutter APIs.

Features #

  • ✅ Get device locale information
  • ✅ Access current app language settings
  • ✅ Retrieve device language and country codes
  • ✅ Listen to locale changes

Installation #

Add the dependency in pubspec.yaml:

dependencies:
  lang_env: ^1.0.0

Then run:

flutter pub get

Usage #

void main() {
  var languageCode = LangEnv.deviceLanguageCode;
  var countryCode = LangEnv.deviceCountryCode;
  LangEnv.setOnLocaleChanged(() {
    var languageCode = LangEnv.deviceLanguageCode;
    var countryCode = LangEnv.deviceCountryCode;
  });
  print('languageCode: $languageCode, countryCode: $countryCode');
}

Example #

See the example directory for a complete sample app.

License #

The project is under the MIT license.

1
likes
160
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter utility package for retrieving device and application locale information using official Flutter APIs.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on lang_env