app-starlock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListSeletMonth_page.dart
魏少阳 fe7cb98cf9 1、修改关于时间的3点讨论结果
a,领锁,点击+号时,如果获取网络时间失败,不进入下一页,提示必须联网
b. 开锁时:有网络时间则同步,无网络则不同步时间
c. 同步时间功能:必须有网才同步时间,确定和通通锁不一致
2、修改登录、注册、修改密码选择跟当前ip不是用一个国家的时候,弹窗提示
2024-06-07 10:53:24 +08:00

99 lines
3.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class CheckingInListSeletMonthPage extends StatefulWidget {
const CheckingInListSeletMonthPage({Key? key}) : super(key: key);
@override
State<CheckingInListSeletMonthPage> createState() => _CheckingInListSeletMonthPageState();
}
class _CheckingInListSeletMonthPageState extends State<CheckingInListSeletMonthPage> {
var _selectMonth = 1;
@override
Widget build(BuildContext context) {
return Dialog(
// insetPadding: EdgeInsets.all(10), //距离
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.w))), //形状
backgroundColor: Colors.white,
clipBehavior: Clip.antiAlias, //强制裁剪
elevation: 10,
child: SizedBox(
//需要在内部限制下高度和宽度才能更好的显示
height: 270.h,
width: 1.sw - 20.w,
child: Column(
children: <Widget>[
SizedBox(height: 10.h),
SizedBox(
height: 80.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
onTap:(){
},
child: Image(width: 50.w, height: 40.w, image: const AssetImage('images/icon_left_black.png'),),
),
SizedBox(width: 50.w,),
Text('2024', style: TextStyle(fontSize: 30.sp, color: Colors.black, fontWeight: FontWeight.w500)),
SizedBox(width: 50.w),
GestureDetector(
onTap: (){
},
child: Image(width: 50.w, height: 40.w, image: const AssetImage('images/icon_right_black.png')),
),
]
),
),
SizedBox(height: 10.h),
Container(
// padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: Expanded(
child: Padding(
padding: EdgeInsets.only(left: 10.w, right: 10.w),
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 6,
// crossAxisSpacing: 5.w,
// mainAxisSpacing: 5.h,
// childAspectRatio: 1.0,
),
itemCount: 12,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: (){
setState(() {
Get.back();
_selectMonth = index + 1;
});
},
child: Container(
width: 60.w,
height: 60.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: index+1 == _selectMonth ? Colors.blue : null,
// color: Colors.blue,
borderRadius: BorderRadius.circular(40.w),
),
child: Text('${index + 1}', style: TextStyle(fontSize: 24.sp, color: index+1 == _selectMonth ? Colors.white : Colors.black)),
),
);
},
),
),
),),
],
)
),
);
}
}