2023-07-10 17:50:31 +08:00
|
|
|
|
|
|
|
|
import 'dart:ui';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
import '../../tools/store_service.dart';
|
|
|
|
|
import '../../translations/app_dept.dart';
|
|
|
|
|
|
|
|
|
|
class MineMultiLanguageState {
|
|
|
|
|
|
|
|
|
|
List<Locale> get languages {
|
|
|
|
|
return appDept.deptSupportedLocales;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-15 15:11:28 +08:00
|
|
|
var currentLanguageType = ExtensionLanguageType.fromLanguageCode(Get.locale!.languageCode).obs;
|
2023-07-10 17:50:31 +08:00
|
|
|
|
|
|
|
|
AppLanuageConfigState() {
|
|
|
|
|
resetLan();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void resetLan() {
|
2023-07-15 15:11:28 +08:00
|
|
|
currentLanguageType.value = ExtensionLanguageType.fromLanguageCode(Get.locale!.languageCode);
|
2023-08-02 09:22:39 +08:00
|
|
|
// StoreService.to.saveLanguageCode(Get.locale!.languageCode);
|
2023-07-10 17:50:31 +08:00
|
|
|
}
|
|
|
|
|
}
|