1.修复睡眠日报中睡眠规律性数据显示错误
2.更新时区设置
This commit is contained in:
@@ -3,9 +3,11 @@ import 'dart:convert';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/pojo/city.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/ListSearchWidget.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/person/person_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
@@ -666,7 +668,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
countries,
|
||||
countryIndex,
|
||||
@@ -684,7 +686,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
provinces,
|
||||
provinceIndex,
|
||||
@@ -702,7 +704,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
cities,
|
||||
cityIndex,
|
||||
@@ -813,3 +815,149 @@ Widget _buildErrorBottomSheet(
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showTimeMHTZonePickerDialog(
|
||||
BuildContext context, {
|
||||
required String initialTimeZone, // 初始时区字符串,如 "UTC+8"
|
||||
required Function(String selectedTimeZone) onConfirm,
|
||||
String title = "选择时区",
|
||||
}) async {
|
||||
// 使用 AppConstants.integerTimeZones 作为数据源
|
||||
List<String> timeZones = AppConstants.integerTimeZones;
|
||||
int selectedIndex = timeZones.indexOf(initialTimeZone);
|
||||
|
||||
// 如果没有找到,使用默认的UTC+8(北京时间)
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = timeZones.indexOf("UTC+8");
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = 0; // 如果连UTC+8都没有,使用第一个
|
||||
}
|
||||
}
|
||||
|
||||
final RxInt tempIndex = RxInt(selectedIndex);
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Dialog(
|
||||
backgroundColor: stringToColor("#003058"),
|
||||
insetPadding: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(0.rpx, 0.rpx, 0.rpx, 90.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
color: themeController.currentColor.sc5,
|
||||
height: 80.rpx,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"取消".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
onConfirm(timeZones[tempIndex.value]);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: stringToColor("#84F5FF"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.rpx),
|
||||
Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 90.rpx,
|
||||
margin:
|
||||
EdgeInsets.symmetric(horizontal: 95.rpx),
|
||||
decoration: BoxDecoration(
|
||||
color: stringToColor("#84F5FF"),
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 240.rpx,
|
||||
child: getOnePickers(
|
||||
context,
|
||||
timeZones, // 传入字符串列表
|
||||
tempIndex,
|
||||
unit: "", // 时区不需要单位
|
||||
selectedColor: stringToColor("#011D33"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user