fts_system_locale 0.0.2 copy "fts_system_locale: ^0.0.2" to clipboard
fts_system_locale: ^0.0.2 copied to clipboard

Change the system locale for your app. You might need this when you localize your flutter app and it includes a native view.

fts_system_locale #

A flutter plugin to set the system locale. This is companion plugin for flutter_translation_sheet package.

Getting Started #

run flutter pub add fts_system_locale in your project directory.

Usage #

Here is an example with the flutter_translation_sheet package.

DropdownButton<Locale>(
  items: AppLocales.supportedLocales
      .map((e) => DropdownMenuItem(value: e, child: Text
      .toList(),
  onChanged: (value) {
    if (value != null) {
      Fts.locale = value;
      FtsSystemLocale().setLocale(value.languageCode).
    }
  },
  value: Fts.locale,
),

check the example dir for a complete example.

Configuration #

Android #

For Android 13+ "per-app-language" support. Follow https://developer.android.com/guide/topics/resources/app-languages#app-language-settings

Others need no extra configuration.

Contributors ✨ #

Thanks goes to these wonderful people (emoji key):


Roi Peker

This project follows the all-contributors specification. Contributions of any kind welcome!

4
likes
150
points
36
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Change the system locale for your app. You might need this when you localize your flutter app and it includes a native view.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on fts_system_locale

Packages that implement fts_system_locale