Files
tuiche/lib/pages/mh_page/sleep_habit.dart
2026-04-07 14:49:31 +08:00

115 lines
4.7 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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';
import 'package:flutter/services.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(
systemOverlayStyle: SystemUiOverlayStyle(
statusBarColor: Colors.transparent, // 状态栏背景色
statusBarIconBrightness: Brightness.light, // 图标颜色Android
statusBarBrightness: Brightness.light, // 图标颜色iOS
),
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(
'睡眠习惯'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
),
// 左侧图标
Positioned(
left: 0.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: () {
Get.toNamed('/rxhxMht');
},
child: Container(
alignment: Alignment.center,
width: bodysize!.maxWidth * 1,
height: bodysize!.maxHeight * 0.056,
child: Text(
'柔性唤醒'.tr,
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(
'睡眠隐私'.tr,
style: TextStyle(
fontSize: 26.rpx, color: Colors.white),
)))
],
))),
)),
);
});
}
}