fix: 欢迎卡片UI优化 + 蓝牙录入按钮 + 多处修复

- 欢迎卡片:去掉白框圆角错位、图片满宽、按钮去箭头改圆角居中
- 渐变actionOutlineGradient改紫蓝双色循环
- 新增健康Agent"蓝牙录入"按钮→蓝牙设备页
- "查看健康情况"改名"健康概览"
- 饮食编辑框删除bug修复(控制器缓存)
- 启动脚本加adb reverse自动转发
- 登录闪屏修复
This commit is contained in:
MingNian
2026-06-17 10:58:59 +08:00
parent 9279b7e283
commit 4f1ad82345
28 changed files with 1641 additions and 1098 deletions

View File

@@ -2,6 +2,23 @@ import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'app_colors.dart';
class AppBackground extends StatelessWidget {
final Widget child;
final bool safeArea;
const AppBackground({super.key, required this.child, this.safeArea = false});
@override
Widget build(BuildContext context) {
final content = safeArea ? SafeArea(child: child) : child;
return DecoratedBox(
decoration: const BoxDecoration(gradient: AppColors.bgGradient),
child: content,
);
}
}
class GradientScaffold extends StatelessWidget {
final PreferredSizeWidget? appBar;
final Widget? body;
@@ -21,8 +38,7 @@ class GradientScaffold extends StatelessWidget {
});
@override
Widget build(BuildContext context) => Container(
decoration: const BoxDecoration(gradient: AppColors.bgGradient),
Widget build(BuildContext context) => AppBackground(
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: appBar,
@@ -123,34 +139,34 @@ class AppTheme {
surface: surface,
brightness: Brightness.light,
),
scaffoldBackgroundColor: bg,
scaffoldBackgroundColor: Colors.transparent,
splashColor: primary.withValues(alpha: 0.06),
highlightColor: Colors.transparent,
hoverColor: primaryLight.withValues(alpha: 0.55),
fontFamily: null,
appBarTheme: const AppBarTheme(
backgroundColor: surface,
appBarTheme: AppBarTheme(
backgroundColor: Colors.white.withValues(alpha: 0.9),
foregroundColor: text,
elevation: 0,
centerTitle: true,
scrolledUnderElevation: 0,
surfaceTintColor: Colors.transparent,
titleTextStyle: TextStyle(
titleTextStyle: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w700,
color: text,
),
toolbarHeight: 48,
toolbarHeight: 52,
),
cardTheme: CardThemeData(
color: surface,
color: Colors.white,
elevation: 0,
surfaceTintColor: Colors.transparent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(rLg),
side: const BorderSide(color: border),
side: const BorderSide(color: AppColors.borderLight),
),
margin: EdgeInsets.zero,
),
@@ -161,15 +177,15 @@ class AppTheme {
contentPadding: const EdgeInsets.symmetric(horizontal: sLg, vertical: 13),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(rMd),
borderSide: const BorderSide(color: border),
borderSide: const BorderSide(color: AppColors.borderLight),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(rMd),
borderSide: const BorderSide(color: border),
borderSide: const BorderSide(color: AppColors.borderLight),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(rMd),
borderSide: const BorderSide(color: primary, width: 1.2),
borderSide: const BorderSide(color: AppColors.auraIndigo, width: 1.3),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(rMd),
@@ -183,7 +199,7 @@ class AppTheme {
backgroundColor: primary,
foregroundColor: Colors.white,
minimumSize: const Size(double.infinity, 50),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(rMd)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(rLg)),
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
elevation: 0,
),