A Flutter plugin for retrieving the device locale information
flutter_device_locale
A Flutter plugin for retrieving the device locale information.
Installation
Add this to your package's pubspec.yaml file:
dependencies:
flutter_device_locale: ^0.3.1
Install packages from the command line (or from your editor):
flutter pub get
Import flutter_device_locale:
import 'package:flutter_device_locale/flutter_device_locale.dart';
Usage
Retrieve the current locale:
Locale locale = await DeviceLocale.getCurrentLocale();
Retrieve the preferred locales:
List<Locale> preferredLocales = await DeviceLocale.getPreferredLocales();