mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
16 lines
382 B
Dart
16 lines
382 B
Dart
|
import 'package:devicelocale/devicelocale.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class LocaleService extends ChangeNotifier {
|
||
|
String _locale = "en_US"; // use default
|
||
|
|
||
|
String get locale => _locale;
|
||
|
|
||
|
Future<void> loadLocale({bool notify = true}) async {
|
||
|
_locale = await Devicelocale.currentLocale ?? "en_US";
|
||
|
if (notify) {
|
||
|
notifyListeners();
|
||
|
}
|
||
|
}
|
||
|
}
|