locale_settings

pub package


A plugin which supports to change the current language on an os level.

Getting Started

Import the package:

import 'package:locale_settings/locale_settings.dart';

Usage

Create a variable for the plugin:

final localeSettingsPlugin = const LocaleSettings();

Set the current locale:

await localeSettingsPlugin.setCurrentLocale(...);

Get the current locale:

final locale = await localeSettingsPlugin.getCurrentLocale();

Listen for changes regarding the current locale:

LocaleListener(
  builder: (final context, final locale) {
    ...
  },
)

Supported systems

Supports Android, iOS and macOS out of the box. To also support Windows, Linux and Web use either locale_settings_hive or locale_settings_preferences