1.修复睡眠日报中睡眠规律性数据显示错误
2.更新时区设置
This commit is contained in:
@@ -69,6 +69,66 @@ Widget getOnePickers(
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||
final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
||||
return Obx(() {
|
||||
return CupertinoPicker.builder(
|
||||
key: pickerKey ?? dynamicKey,
|
||||
itemExtent: 90.rpx,
|
||||
useMagnifier: false,
|
||||
magnification: 1,
|
||||
diameterRatio: 1.3,
|
||||
squeeze: 1,
|
||||
scrollController:
|
||||
FixedExtentScrollController(initialItem: selectedIndex.value),
|
||||
selectionOverlay: Container(),
|
||||
onSelectedItemChanged: (int index) {
|
||||
selectedIndex.value = index;
|
||||
if (onChanged != null) onChanged(index);
|
||||
},
|
||||
childCount: arr.length,
|
||||
itemBuilder: (context, index) {
|
||||
final bool isSelected = index == selectedIndex.value;
|
||||
|
||||
// 显示文本
|
||||
String displayText;
|
||||
if (isMonthName && isEn && arr[index] is int) {
|
||||
displayText = DateFormat.MMMM('en').format(DateTime(0, arr[index]));
|
||||
} else {
|
||||
displayText = "${arr[index]}$unit";
|
||||
}
|
||||
|
||||
return Center(
|
||||
child: Text(
|
||||
displayText,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: isSelected
|
||||
? (selectedColor ??
|
||||
themeController.currentColor.sc3) // ✅ 优先使用外部颜色
|
||||
: const Color(0xFF9AA0B3),
|
||||
fontSize: 30.rpx,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget getOnePickersCity(
|
||||
BuildContext context,
|
||||
List arr,
|
||||
RxInt selectedIndex, {
|
||||
String unit = '',
|
||||
bool looping = false,
|
||||
void Function(int)? onChanged,
|
||||
bool isMonthName = false,
|
||||
Key? pickerKey,
|
||||
Color? selectedColor, // ✅ 新增:选中颜色(可选)
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||
|
||||
return Obx(() {
|
||||
final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
||||
@@ -132,9 +192,8 @@ Widget getOnePickersSpe(
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
final bool isEn = Get.locale?.languageCode.startsWith('en') ?? false;
|
||||
|
||||
final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
||||
return Obx(() {
|
||||
final dynamicKey = ValueKey('picker_${arr.length}_${selectedIndex.value}');
|
||||
return CupertinoPicker.builder(
|
||||
key: pickerKey ?? dynamicKey,
|
||||
itemExtent: 90.rpx,
|
||||
@@ -1777,8 +1836,7 @@ Future showCustomConfirmOfWebViewDialog(
|
||||
bool showCancel = false,
|
||||
String cancelName = "取消",
|
||||
ConfirmDialogIcon icon = ConfirmDialogIcon.warn,
|
||||
int type = 1
|
||||
}) async {
|
||||
int type = 1}) async {
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
@@ -1865,7 +1923,9 @@ Future showCustomConfirmOfWebViewDialog(
|
||||
onTap: () {
|
||||
Get.back(result: "confirm");
|
||||
},
|
||||
colors: type == 3?AppConstants().mhtNormalButton:AppConstants().thNormalButton, // 渐变背景
|
||||
colors: type == 3
|
||||
? AppConstants().mhtNormalButton
|
||||
: AppConstants().thNormalButton, // 渐变背景
|
||||
gradientDirection: GradientDirection.horizontal,
|
||||
child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width * 0.5, // 宽度占屏幕一半
|
||||
|
||||
Reference in New Issue
Block a user