更新默认本地语言
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:EasyDartModule/EasyDartModule.dart' as edm;
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
@@ -19,6 +20,8 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/time/countdown_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/model/api_response.dart';
|
||||
import 'package:vbvs_app/pages/user/privacy_scheme_page.dart';
|
||||
import 'package:vbvs_app/pages/user/user_scheme_page.dart';
|
||||
|
||||
class OtherLoginPage extends StatefulWidget {
|
||||
const OtherLoginPage({super.key});
|
||||
@@ -34,10 +37,32 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
CountdownController countdownController = Get.find();
|
||||
LoginController loginController = Get.find();
|
||||
|
||||
late TapGestureRecognizer _tapRecognizer2;
|
||||
late TapGestureRecognizer _tapRecognizer4;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tapRecognizer2.dispose();
|
||||
_tapRecognizer4.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
_tapRecognizer2 = TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 协议2点击事件逻辑
|
||||
print('点击了协议2');
|
||||
// Get.to(() => UserSchemePage());
|
||||
Get.toNamed("/userSchemePage");
|
||||
};
|
||||
_tapRecognizer4 = TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
// 协议4点击事件逻辑
|
||||
print('点击了协议4');
|
||||
Get.toNamed("/privacyPage");
|
||||
};
|
||||
super.initState();
|
||||
LoginController loginController = Get.find();
|
||||
Fluwx fluwx = loginController.fluwx;
|
||||
@@ -668,6 +693,86 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
checkColor: Colors.white,
|
||||
),
|
||||
)),
|
||||
// Expanded(
|
||||
// child: Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||
// 0.rpx, 10.rpx, 0.rpx, 0.rpx),
|
||||
// child: Container(
|
||||
// width: bodysize.maxWidth,
|
||||
// constraints: BoxConstraints(
|
||||
// minWidth: 500.rpx,
|
||||
// minHeight: 90.rpx,
|
||||
// ),
|
||||
// child: RichText(
|
||||
// text: TextSpan(
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text: '登录页.协议1'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议2'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color:
|
||||
// stringToColor("#FF9F66"),
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议3'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议4'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color:
|
||||
// stringToColor("#FF9F66"),
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议5'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议6'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color:
|
||||
// stringToColor("#FF9F66"),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
@@ -700,6 +805,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
color:
|
||||
stringToColor("#FF9F66"),
|
||||
),
|
||||
recognizer: _tapRecognizer2,
|
||||
),
|
||||
TextSpan(
|
||||
text: '登录页.协议3'.tr,
|
||||
@@ -720,27 +826,28 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
|
||||
color:
|
||||
stringToColor("#FF9F66"),
|
||||
),
|
||||
recognizer: _tapRecognizer4,
|
||||
),
|
||||
TextSpan(
|
||||
text: '登录页.协议5'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 20.rpx,
|
||||
color: themeController
|
||||
.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '登录页.协议6'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 20.rpx,
|
||||
color:
|
||||
stringToColor("#FF9F66"),
|
||||
),
|
||||
),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议5'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color: themeController
|
||||
// .currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// TextSpan(
|
||||
// text: '登录页.协议6'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 20.rpx,
|
||||
// color:
|
||||
// stringToColor("#FF9F66"),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/enum/LoginStatus.dart';
|
||||
|
||||
class EPage extends StatefulWidget {
|
||||
const EPage({super.key});
|
||||
@@ -69,7 +70,17 @@ class _EPageState extends State<EPage> {
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.all(0.rpx),
|
||||
onTap: () {
|
||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||
UserInfoController userInfoController = Get.find();
|
||||
bool isLoggedIn =
|
||||
userInfoController.model.login == LoginStatus.LOGIN.code;
|
||||
if (!isLoggedIn) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "必须登录提示".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
Get.toNamed("/otherLoginPage");
|
||||
} else {
|
||||
TopSlideNotification.show(context, text: "待开发功能".tr);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
// child: widget.webView,
|
||||
|
||||
@@ -995,86 +995,80 @@ class _HomePageState extends State<HomePage> {
|
||||
}
|
||||
|
||||
return Expanded(
|
||||
child: SingleChildScrollView(child:
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(height: 26.rpx), // 第一个上方间距
|
||||
...List.generate(deviceList.length, (i) {
|
||||
String mac = macList[i];
|
||||
List<dynamic> dailyDataList =
|
||||
reportData[mac]!;
|
||||
Map? targetDevice =
|
||||
deviceList.firstWhereOrNull(
|
||||
(device) => device['mac'] == mac,
|
||||
);
|
||||
List stateModule = [];
|
||||
String currentTime = "";
|
||||
String goalMac = targetDevice?['mac'];
|
||||
var person = targetDevice?['person'];
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 26.rpx), // 第一个上方间距
|
||||
...List.generate(deviceList.length, (i) {
|
||||
String mac = macList[i];
|
||||
List<dynamic> dailyDataList = reportData[mac]!;
|
||||
Map? targetDevice = deviceList.firstWhereOrNull(
|
||||
(device) => device['mac'] == mac,
|
||||
);
|
||||
List stateModule = [];
|
||||
String currentTime = "";
|
||||
String goalMac = targetDevice?['mac'];
|
||||
var person = targetDevice?['person'];
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
DynamicReportDetailWidget(
|
||||
key: ValueKey(
|
||||
'${targetDevice!['mac']}_${homeController.model.type}'),
|
||||
targetDevice: targetDevice!,
|
||||
sleepDateWidgets: List.generate(
|
||||
dailyDataList.length, (j) {
|
||||
|
||||
|
||||
var dayData = dailyDataList[j];
|
||||
DateTime date = DateTime
|
||||
.fromMillisecondsSinceEpoch(
|
||||
dayData['time'] is String
|
||||
? int.parse(dayData['time'])
|
||||
: dayData['time'],
|
||||
);
|
||||
if (dayData['selected'] == true &&
|
||||
dayData['state'] != null) {
|
||||
stateModule = dayData['state'];
|
||||
currentTime = dayData['time'];
|
||||
}
|
||||
return SleepDateWidget(
|
||||
mac: mac,
|
||||
time: dayData['time'],
|
||||
date: date,
|
||||
score: dayData['score']?['socre']
|
||||
?.toString() ??
|
||||
'',
|
||||
comment: dayData['score']?['name'],
|
||||
textColor: dayData['score']
|
||||
?['color'] ==
|
||||
null
|
||||
? null
|
||||
: stringToColor(
|
||||
dayData['score']?['color']),
|
||||
isSelected: dayData['selected'],
|
||||
);
|
||||
}),
|
||||
sleepDataModuleWidgets: stateModule
|
||||
.isNotEmpty
|
||||
? List.generate(stateModule.length,
|
||||
(j) {
|
||||
stateModule[j]['onto'] = true;
|
||||
stateModule[j]['time'] =
|
||||
currentTime;
|
||||
stateModule[j]['mac'] = goalMac;
|
||||
stateModule[j]['person'] =
|
||||
person;
|
||||
return SleepDataModuleWidget(
|
||||
data: stateModule[j]);
|
||||
})
|
||||
: [],
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
26.rpx), // 每个 widget 下方间距(包括最后一个)
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
)
|
||||
),
|
||||
return Column(
|
||||
children: [
|
||||
DynamicReportDetailWidget(
|
||||
key: ValueKey(
|
||||
'${targetDevice!['mac']}_${homeController.model.type}'),
|
||||
targetDevice: targetDevice!,
|
||||
sleepDateWidgets: List.generate(
|
||||
dailyDataList.length, (j) {
|
||||
var dayData = dailyDataList[j];
|
||||
DateTime date =
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
dayData['time'] is String
|
||||
? int.parse(dayData['time'])
|
||||
: dayData['time'],
|
||||
);
|
||||
if (dayData['selected'] == true &&
|
||||
dayData['state'] != null) {
|
||||
stateModule = dayData['state'];
|
||||
currentTime = dayData['time'];
|
||||
}
|
||||
return SleepDateWidget(
|
||||
mac: mac,
|
||||
time: dayData['time'],
|
||||
date: date,
|
||||
score: dayData['score']?['socre']
|
||||
?.toString() ??
|
||||
'',
|
||||
comment: dayData['score']?['name'],
|
||||
textColor: dayData['score']
|
||||
?['color'] ==
|
||||
null
|
||||
? null
|
||||
: stringToColor(
|
||||
dayData['score']?['color']),
|
||||
isSelected: dayData['selected'],
|
||||
);
|
||||
}),
|
||||
sleepDataModuleWidgets: stateModule
|
||||
.isNotEmpty
|
||||
? List.generate(stateModule.length,
|
||||
(j) {
|
||||
stateModule[j]['onto'] = true;
|
||||
stateModule[j]['time'] =
|
||||
currentTime;
|
||||
stateModule[j]['mac'] = goalMac;
|
||||
stateModule[j]['person'] = person;
|
||||
return SleepDataModuleWidget(
|
||||
data: stateModule[j]);
|
||||
})
|
||||
: [],
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
26.rpx), // 每个 widget 下方间距(包括最后一个)
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
)),
|
||||
);
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -141,7 +141,8 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
bool isLoggedIn = userInfoController.model.login ==
|
||||
LoginStatus.LOGIN.code;
|
||||
|
||||
if ((index == 1 || index == 2) && !isLoggedIn) {
|
||||
// if ((index == 1 || index == 2) && !isLoggedIn) {
|
||||
if ((index == 2) && !isLoggedIn) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "必须登录提示".tr,
|
||||
|
||||
@@ -6,7 +6,6 @@ import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mh_language_controller.dart';
|
||||
import 'package:vbvs_app/controller/setting/language/language_controller.dart';
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
import 'package:vbvs_app/pages/device_bind/componnet/FancyCircleCheckbox.dart';
|
||||
@@ -19,7 +18,7 @@ class LanguageSetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LanguageSettingState extends State<LanguageSetting> {
|
||||
MHLanguageController languageController = Get.find();
|
||||
LanguageController languageController = Get.find();
|
||||
@override
|
||||
void initState() {
|
||||
// languageController.initLanuageList();
|
||||
@@ -129,6 +128,15 @@ class _LanguageSettingState extends State<LanguageSetting> {
|
||||
.language_code); // 加载语言
|
||||
languageController
|
||||
.updateAll(); // 更新操作
|
||||
try {
|
||||
// ef.kv.set("language",
|
||||
// language.language_code);
|
||||
await ef.kvdb.write(
|
||||
"th/language",
|
||||
language.language_code);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
||||
Reference in New Issue
Block a user