stack_wallet/lib/services/locale_service.dart

16 lines
382 B
Dart
Raw Normal View History

2022-08-26 08:11:35 +00:00
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();
}
}
}