75 lines
1.9 KiB
Dart
75 lines
1.9 KiB
Dart
import 'dart:typed_data';
|
||
|
||
import 'package:flutter/widgets.dart';
|
||
import 'package:get/get.dart';
|
||
import 'package:star_lock/main/lockDetail/lockDetail/passthrough_item.dart';
|
||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||
import 'package:star_lock/translations/app_dept.dart';
|
||
|
||
class SpeechLanguageSettingsState {
|
||
SpeechLanguageSettingsState() {
|
||
final map = Get.arguments;
|
||
lockSetInfoData.value = map['lockSetInfoData'];
|
||
}
|
||
|
||
List<String> get appLocalLanguages {
|
||
final locales = appDept.deptSupportedLocales;
|
||
|
||
final languageCode = locales[1].languageCode;
|
||
final countryCode = locales[1].countryCode;
|
||
String localeStr = '';
|
||
if (countryCode != null) {
|
||
localeStr = languageCode + '_' + countryCode;
|
||
appLocalLanguageCodes.add(localeStr);
|
||
}
|
||
|
||
final list = locales
|
||
.map((e) => ExtensionLanguageType.fromLocale(e).lanTitle)
|
||
.toList();
|
||
return list;
|
||
}
|
||
|
||
List<String> appLocalLanguageCodes = [];
|
||
|
||
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||
|
||
// 选中的语音包列表下标
|
||
RxInt selectPassthroughListIndex = 0.obs;
|
||
|
||
// 选中的语音下标
|
||
RxInt selectLanguageIndex = 0.obs;
|
||
|
||
final RxList<PassthroughItem> languages = <PassthroughItem>[].obs;
|
||
|
||
RxBool otaUpdateIng = false.obs;
|
||
RxDouble otaProgress = 0.00.obs;
|
||
RxString deviceModel = '2403'.obs;
|
||
Uint8List? data;
|
||
|
||
// 语音包最大大小
|
||
int voiceSubcontractingSize = 256;
|
||
|
||
// 总数据包数量
|
||
int voiceSubcontractingCount = 0;
|
||
|
||
// 数据包序列号
|
||
int voiceSubcontractingIndex = 0;
|
||
|
||
// 分包发送进度(0.0~1.0)
|
||
RxDouble progress = 0.0.obs;
|
||
|
||
RxInt selectedValue = 1.obs;
|
||
|
||
// 响应式字符串集合(自动触发 UI 更新)
|
||
final RxList<String> soundTypeList = List.of({
|
||
'男声'.tr,
|
||
'女声'.tr,
|
||
}).obs;
|
||
|
||
RxInt selectSoundTypeIndex = 0.obs;
|
||
|
||
|
||
RxString tempLangStr=''.obs;
|
||
RxString tempTimbreStr=''.obs;
|
||
}
|