158 lines
3.7 KiB
Dart
158 lines
3.7 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:qhd_prevention/customWidget/item_list_widget.dart';
|
|
|
|
|
|
class HomeworkEntrance extends StatefulWidget {
|
|
const HomeworkEntrance(this.title, {super.key});
|
|
|
|
final String title;
|
|
|
|
@override
|
|
State<HomeworkEntrance> createState() => HomeworkEntranceState();
|
|
}
|
|
|
|
class HomeworkEntranceState extends State<HomeworkEntrance> {
|
|
|
|
// 设置项状态
|
|
bool notificationsEnabled = false;
|
|
bool passwordChanged = false;
|
|
bool updateAvailable = false;
|
|
bool logoutSelected = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Color(0xFFF3F4F7),
|
|
body: SingleChildScrollView(
|
|
// child: Padding(
|
|
// padding: const EdgeInsets.all(24.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// 顶部标题区域
|
|
_buildHeaderSection(),
|
|
const SizedBox(height: 20),
|
|
// 底部按钮
|
|
// _buildActionButton(),
|
|
],
|
|
),
|
|
// ),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildHeaderSection() {
|
|
return Stack(
|
|
alignment: const FractionalOffset(0.5, 0),
|
|
children: [
|
|
|
|
|
|
Padding(
|
|
padding: EdgeInsets.fromLTRB(0,0,0,10),
|
|
child: Image.asset(
|
|
"assets/images/xiangguan_rukou_bg.png",
|
|
width: MediaQuery.of(context).size.width, // 获取屏幕宽度
|
|
fit: BoxFit.cover,
|
|
)
|
|
),
|
|
|
|
Positioned(
|
|
top: 51,
|
|
child: Text(widget.title,style: TextStyle(color: Colors.white,fontSize: 20,fontWeight: FontWeight.bold,),),
|
|
),
|
|
|
|
|
|
//返回按钮
|
|
Positioned(
|
|
top: 2,
|
|
left: 0,
|
|
child: Padding(
|
|
padding: EdgeInsets.only(left: Platform.isIOS ? 4.0 : 8.0,top: 40),
|
|
child: IconButton(
|
|
icon: Icon(
|
|
Platform.isIOS ? Icons.arrow_back_ios : Icons.arrow_back,
|
|
color: Colors.white,
|
|
size: Platform.isIOS ? 20.0 : 24.0, // iOS使用更小图标
|
|
),
|
|
padding: EdgeInsets.all(0), // 移除默认内边距
|
|
constraints: const BoxConstraints(), // 移除默认约束
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
),
|
|
),
|
|
),
|
|
|
|
|
|
// 我的工作区
|
|
_buildSettingsList(),
|
|
// _buildWorkSection(),
|
|
|
|
],
|
|
|
|
|
|
);
|
|
}
|
|
|
|
|
|
Widget _buildSettingsList() {
|
|
return
|
|
Container(
|
|
margin: EdgeInsets.fromLTRB(0,190,0,0),
|
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 20),
|
|
// margin: const EdgeInsets.fromLTRB(20,0,20,0),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFFF3F4F7),
|
|
borderRadius:BorderRadius.only(topLeft:Radius.circular(30) ,topRight: Radius.circular(30)) ,
|
|
|
|
|
|
),
|
|
child: Column(
|
|
children: [
|
|
|
|
SizedBox(height: 30,),
|
|
|
|
GestureDetector(
|
|
child: _setItemWidget("申请","assets/images/xiangguan_rukou1.png"),
|
|
onTap: () {
|
|
|
|
},
|
|
),
|
|
SizedBox(height: 5,),
|
|
|
|
GestureDetector(
|
|
child: _setItemWidget("待办","assets/images/xiangguan_rukou2.png"),
|
|
onTap: () {
|
|
|
|
},
|
|
),
|
|
SizedBox(height: 5,),
|
|
|
|
GestureDetector(
|
|
child: _setItemWidget("已办","assets/images/xiangguan_rukou3.png"),
|
|
onTap: () {
|
|
|
|
},
|
|
),
|
|
SizedBox(height: 5,),
|
|
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
|
|
|
|
Widget _setItemWidget(final String text,final String imagePath) {
|
|
return ItemListWidget.OneRowImageArrowTitle(
|
|
label: text,
|
|
imgPath: imagePath,
|
|
);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|