修改选择器样式
This commit is contained in:
106
lib/pages/mh_page/sleep_habit.dart
Normal file
106
lib/pages/mh_page/sleep_habit.dart
Normal file
@@ -0,0 +1,106 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
|
||||
class SleepHabitPage extends StatefulWidget {
|
||||
@override
|
||||
_SleepHabitPageState createState() => _SleepHabitPageState();
|
||||
}
|
||||
|
||||
BoxConstraints? bodysize;
|
||||
|
||||
class _SleepHabitPageState extends State<SleepHabitPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
bodysize = cc;
|
||||
return GestureDetector(
|
||||
onTap: () => FocusScope.of(context).unfocus(),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'), // 本地图片
|
||||
fit: BoxFit.fill, // 填满整个 Container
|
||||
),
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 0,
|
||||
title: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// 中间居中的标题
|
||||
Text(
|
||||
'设备报修',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 20.rpx,
|
||||
child: returnIconButtomNew,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
centerTitle: false,
|
||||
),
|
||||
body: SafeArea(
|
||||
top: true,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 30.rpx, right: 30.rpx, top: 30.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Color(0XFF003058),
|
||||
highlightColor: Color(0XFF055466),
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: bodysize!.maxWidth * 1,
|
||||
height: bodysize!.maxHeight * 0.056,
|
||||
child: Text(
|
||||
'柔性唤醒',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
))),
|
||||
SizedBox(height: 20.rpx),
|
||||
ClickableContainer(
|
||||
backgroundColor: Color(0XFF003058),
|
||||
highlightColor: Color(0XFF055466),
|
||||
borderRadius: 16.rpx,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
Get.toNamed('/syms');
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: bodysize!.maxWidth * 1,
|
||||
height: bodysize!.maxHeight * 0.056,
|
||||
child: Text(
|
||||
'睡眠隐私',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
)))
|
||||
],
|
||||
))),
|
||||
)),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user