mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-27 05:49:21 +00:00
29 lines
698 B
Dart
29 lines
698 B
Dart
/*
|
|
* This file is part of Stack Wallet.
|
|
*
|
|
* Copyright (c) 2023 Cypher Stack
|
|
* All Rights Reserved.
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
*
|
|
*/
|
|
|
|
import 'dart:io';
|
|
|
|
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 = Platform.isWindows
|
|
? "en_US"
|
|
: (await Devicelocale.currentAsLocale)?.toString() ?? "en_US";
|
|
if (notify) {
|
|
notifyListeners();
|
|
}
|
|
}
|
|
}
|