|
|
@ -27,6 +27,7 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
|
|
|
|
Timer? _clockSetState;
|
|
|
|
Timer? _clockSetState;
|
|
|
|
DateTime? _lastPressed;
|
|
|
|
DateTime? _lastPressed;
|
|
|
|
TodayClockRecordModel? _model;
|
|
|
|
TodayClockRecordModel? _model;
|
|
|
|
|
|
|
|
|
|
|
|
bool get canTap {
|
|
|
|
bool get canTap {
|
|
|
|
if (_lastPressed == null ||
|
|
|
|
if (_lastPressed == null ||
|
|
|
|
DateTime.now().difference(_lastPressed!) > Duration(seconds: 15)) {
|
|
|
|
DateTime.now().difference(_lastPressed!) > Duration(seconds: 15)) {
|
|
|
@ -81,43 +82,51 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: _model == null
|
|
|
|
margin: EdgeInsets.all(32.w),
|
|
|
|
? Container()
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.all(32.w),
|
|
|
|
child: Column(
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
children: [
|
|
|
|
width: double.infinity,
|
|
|
|
DateUtil.formatDate(DateTime.now(), format: 'yyyy.MM.dd')
|
|
|
|
child: Column(
|
|
|
|
.text
|
|
|
|
children: [
|
|
|
|
.size(28.sp)
|
|
|
|
DateUtil.formatDate(DateTime.now(), format: 'yyyy.MM.dd')
|
|
|
|
.color(kTextPrimaryColor)
|
|
|
|
.text
|
|
|
|
.make(),
|
|
|
|
.size(28.sp)
|
|
|
|
16.w.heightBox,
|
|
|
|
.color(kTextPrimaryColor)
|
|
|
|
WeekDaysToChinese.fromString(DateUtil.getWeekday(DateTime.now()))
|
|
|
|
.make(),
|
|
|
|
.text
|
|
|
|
16.w.heightBox,
|
|
|
|
.size(24.sp)
|
|
|
|
WeekDaysToChinese.fromString(
|
|
|
|
.color(kTextPrimaryColor)
|
|
|
|
DateUtil.getWeekday(DateTime.now()))
|
|
|
|
.make(),
|
|
|
|
.text
|
|
|
|
64.w.heightBox,
|
|
|
|
.size(24.sp)
|
|
|
|
Row(
|
|
|
|
.color(kTextPrimaryColor)
|
|
|
|
children: [
|
|
|
|
.make(),
|
|
|
|
_buildCard(0,
|
|
|
|
64.w.heightBox,
|
|
|
|
time: UserTool.appProvider.clockInTime,
|
|
|
|
Row(
|
|
|
|
checkTime: _model!.startTime),
|
|
|
|
children: [
|
|
|
|
Spacer(),
|
|
|
|
_buildCard(0,
|
|
|
|
_buildCard(1,
|
|
|
|
time: UserTool.appProvider.clockInTime,
|
|
|
|
time: UserTool.appProvider.clockOutTime,
|
|
|
|
checkTime: _model!.startTime),
|
|
|
|
checkTime: _model!.endTime)
|
|
|
|
Spacer(),
|
|
|
|
], //上班打卡为‘type’0.下班打卡为1
|
|
|
|
_buildCard(1,
|
|
|
|
|
|
|
|
time: UserTool.appProvider.clockOutTime,
|
|
|
|
|
|
|
|
checkTime: _model!.endTime)
|
|
|
|
|
|
|
|
], //上班打卡为‘type’0.下班打卡为1
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
150.w.heightBox,
|
|
|
|
|
|
|
|
_buildClock(),
|
|
|
|
|
|
|
|
65.w.heightBox,
|
|
|
|
|
|
|
|
'今日工时'.text.size(24.sp).bold.color(kTextSubColor).make(),
|
|
|
|
|
|
|
|
'共$getWorkHours'
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.size(24.sp)
|
|
|
|
|
|
|
|
.bold
|
|
|
|
|
|
|
|
.color(kTextSubColor)
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
150.w.heightBox,
|
|
|
|
|
|
|
|
_buildClock(),
|
|
|
|
|
|
|
|
65.w.heightBox,
|
|
|
|
|
|
|
|
'今日工时'.text.size(24.sp).bold.color(kTextSubColor).make(),
|
|
|
|
|
|
|
|
'共$getWorkHours'.text.size(24.sp).bold.color(kTextSubColor).make(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|