更新首页
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
|||||||
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
import 'package:vbvs_app/common/color/app_uri_status.dart';
|
||||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||||
|
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
|
||||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||||
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
||||||
@@ -66,7 +67,8 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
}
|
}
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (homeController.sleepDays.value.isNotEmpty) {
|
if (homeController.sleepDays.value.isNotEmpty) {
|
||||||
homeController.selectedDayIndex.value = homeController.sleepDays.value.length - 1;
|
homeController.selectedDayIndex.value =
|
||||||
|
homeController.sleepDays.value.length - 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -411,7 +413,8 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
personInfo.value =
|
personInfo.value =
|
||||||
selectedPerson;
|
selectedPerson;
|
||||||
|
|
||||||
homeController.selectedDayIndex =
|
homeController
|
||||||
|
.selectedDayIndex =
|
||||||
(6).obs;
|
(6).obs;
|
||||||
print("$val");
|
print("$val");
|
||||||
if (val == null) {
|
if (val == null) {
|
||||||
@@ -470,11 +473,18 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
.value !=
|
.value !=
|
||||||
null) {
|
null) {
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
"/sleepWebview",
|
"/newSleepReportPage",
|
||||||
arguments: [
|
arguments: {
|
||||||
formFieldController
|
'mac':
|
||||||
.value
|
formFieldController
|
||||||
]);
|
.value!,
|
||||||
|
'type': 1,
|
||||||
|
"person": personInfo
|
||||||
|
.value,
|
||||||
|
'backgroundImg':
|
||||||
|
'assets/images/new_background.png',
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -501,138 +511,152 @@ class _NewHomePageState extends State<NewHomePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
if (homeController
|
||||||
padding: EdgeInsets.only(
|
.sleepDays.value.length ==
|
||||||
top: 0.rpx,
|
0)
|
||||||
bottom: 20.rpx,
|
Expanded(child: NullDataWidget()),
|
||||||
left: 16.rpx,
|
if (homeController
|
||||||
right: 16.rpx,
|
.sleepDays.value.length !=
|
||||||
),
|
0)
|
||||||
width: double.infinity,
|
Container(
|
||||||
decoration: BoxDecoration(),
|
padding: EdgeInsets.only(
|
||||||
child: Obx(() => Row(
|
top: 0.rpx,
|
||||||
mainAxisSize:
|
bottom: 20.rpx,
|
||||||
MainAxisSize.max,
|
left: 16.rpx,
|
||||||
crossAxisAlignment:
|
right: 16.rpx,
|
||||||
CrossAxisAlignment.start,
|
),
|
||||||
children: [
|
width: double.infinity,
|
||||||
...List.generate(
|
decoration: BoxDecoration(),
|
||||||
homeController
|
child: Obx(() => Row(
|
||||||
.sleepDays
|
mainAxisSize:
|
||||||
.value
|
MainAxisSize.max,
|
||||||
.length, (index) {
|
crossAxisAlignment:
|
||||||
var day = homeController
|
CrossAxisAlignment
|
||||||
.sleepDays[index];
|
.start,
|
||||||
bool isSelected =
|
children: [
|
||||||
homeController.selectedDayIndex
|
...List.generate(
|
||||||
.value ==
|
homeController
|
||||||
index;
|
.sleepDays
|
||||||
return Expanded(
|
.value
|
||||||
child: GestureDetector(
|
.length, (index) {
|
||||||
onTap: () {
|
var day = homeController
|
||||||
homeController.selectedDayIndex
|
.sleepDays[index];
|
||||||
.value = index;
|
bool isSelected =
|
||||||
int? timeMillis =
|
homeController
|
||||||
parseToInt(day[
|
.selectedDayIndex
|
||||||
'time']); // 使用我们刚才封装的安全转换函数
|
.value ==
|
||||||
Get.toNamed(
|
index;
|
||||||
"/newSleepReportPage",
|
return Expanded(
|
||||||
arguments: {
|
child:
|
||||||
'date':
|
GestureDetector(
|
||||||
timeMillis,
|
onTap: () {
|
||||||
'mac':
|
homeController
|
||||||
formFieldController
|
.selectedDayIndex
|
||||||
.value!,
|
.value = index;
|
||||||
'type': 1,
|
int? timeMillis =
|
||||||
"person":
|
parseToInt(day[
|
||||||
personInfo
|
'time']); // 使用我们刚才封装的安全转换函数
|
||||||
.value,
|
Get.toNamed(
|
||||||
'backgroundImg':
|
"/newSleepReportPage",
|
||||||
'assets/images/new_background.png',
|
arguments: {
|
||||||
// 'backgroundColor':stringToColor("#003058"),
|
'date':
|
||||||
},
|
timeMillis,
|
||||||
);
|
'mac':
|
||||||
},
|
formFieldController
|
||||||
child: Container(
|
.value!,
|
||||||
padding:
|
'type': 1,
|
||||||
EdgeInsets.only(
|
"person":
|
||||||
top: 10.rpx,
|
personInfo
|
||||||
bottom: 20.rpx,
|
.value,
|
||||||
),
|
'backgroundImg':
|
||||||
width: 90.rpx,
|
'assets/images/new_background.png',
|
||||||
decoration:
|
'date':
|
||||||
BoxDecoration(
|
timeMillis,
|
||||||
color: isSelected
|
// 'backgroundColor':stringToColor("#003058"),
|
||||||
? stringToColor(
|
},
|
||||||
"#184468")
|
);
|
||||||
: Colors
|
},
|
||||||
.transparent,
|
child: Container(
|
||||||
borderRadius:
|
padding:
|
||||||
BorderRadius
|
EdgeInsets
|
||||||
.circular(
|
.only(
|
||||||
8.rpx),
|
top: 10.rpx,
|
||||||
),
|
bottom: 20.rpx,
|
||||||
child: Column(
|
),
|
||||||
mainAxisSize:
|
width: 90.rpx,
|
||||||
MainAxisSize
|
decoration:
|
||||||
.max,
|
BoxDecoration(
|
||||||
mainAxisAlignment:
|
color: isSelected
|
||||||
MainAxisAlignment
|
? stringToColor(
|
||||||
.start,
|
"#184468")
|
||||||
crossAxisAlignment:
|
: Colors
|
||||||
CrossAxisAlignment
|
.transparent,
|
||||||
.center,
|
borderRadius:
|
||||||
children: [
|
BorderRadius
|
||||||
Text(
|
.circular(
|
||||||
day['week'],
|
8.rpx),
|
||||||
style: FlutterFlowTheme.of(
|
),
|
||||||
context)
|
child: Column(
|
||||||
.bodyMedium
|
mainAxisSize:
|
||||||
.override(
|
MainAxisSize
|
||||||
fontFamily:
|
.max,
|
||||||
'Readex Pro',
|
mainAxisAlignment:
|
||||||
fontSize:
|
MainAxisAlignment
|
||||||
30.rpx,
|
.start,
|
||||||
letterSpacing:
|
crossAxisAlignment:
|
||||||
0,
|
CrossAxisAlignment
|
||||||
color: stringToColor(
|
.center,
|
||||||
"#FFFFFF"),
|
children: [
|
||||||
),
|
Text(
|
||||||
),
|
day['week'],
|
||||||
SizedBox(
|
style: FlutterFlowTheme.of(
|
||||||
height:
|
context)
|
||||||
12.rpx),
|
.bodyMedium
|
||||||
Text(
|
.override(
|
||||||
day['date'],
|
fontFamily:
|
||||||
// "哈哈",
|
'Readex Pro',
|
||||||
style: FlutterFlowTheme.of(
|
fontSize:
|
||||||
context)
|
30.rpx,
|
||||||
.bodyMedium
|
letterSpacing:
|
||||||
.override(
|
0,
|
||||||
fontFamily:
|
color:
|
||||||
'Readex Pro',
|
stringToColor("#FFFFFF"),
|
||||||
letterSpacing:
|
),
|
||||||
0,
|
),
|
||||||
fontSize:
|
SizedBox(
|
||||||
22.rpx,
|
height: 12
|
||||||
color: stringToColor(
|
.rpx),
|
||||||
"#929699"),
|
Text(
|
||||||
),
|
day['date'],
|
||||||
),
|
// "哈哈",
|
||||||
SizedBox(
|
style: FlutterFlowTheme.of(
|
||||||
height:
|
context)
|
||||||
39.rpx),
|
.bodyMedium
|
||||||
buildScoreOrIcon(
|
.override(
|
||||||
day['score']),
|
fontFamily:
|
||||||
],
|
'Readex Pro',
|
||||||
|
letterSpacing:
|
||||||
|
0,
|
||||||
|
fontSize:
|
||||||
|
22.rpx,
|
||||||
|
color:
|
||||||
|
stringToColor("#929699"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 39
|
||||||
|
.rpx),
|
||||||
|
buildScoreOrIcon(
|
||||||
|
day['score']),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
})
|
||||||
})
|
],
|
||||||
],
|
)),
|
||||||
)),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user