This commit is contained in:
wyf
2025-04-12 18:13:35 +08:00
parent 9396f18d09
commit 146462b467
17 changed files with 1446 additions and 816 deletions

View File

@@ -39,7 +39,7 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="智慧眠花糖"> android:label="太和e护">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

View File

@@ -13,7 +13,8 @@
"提示内容2": "2.对APP进行蓝牙和位置定位服务授权", "提示内容2": "2.对APP进行蓝牙和位置定位服务授权",
"提示内容3": "3.若使用扫一扫功能,请对摄像头进行授权。", "提示内容3": "3.若使用扫一扫功能,请对摄像头进行授权。",
"扫一扫绑定": "扫一扫添加新设备", "扫一扫绑定": "扫一扫添加新设备",
"蓝牙绑定": "蓝牙搜附近的设备" "蓝牙绑定": "蓝牙搜附近的设备",
"已关联体征监测设备": "已关联体征监测设备"
}, },
"我的": { "我的": {
"个人信息": "个人信息", "个人信息": "个人信息",
@@ -37,6 +38,44 @@
"说明正文": "该体征监测设备在床垫下方使用(注意贴有标签的一面朝上),放置在靠近使用人胸腔正下方为宜。放置完成后,连接电源,控制盒绿灯快闪时,可以进行绑定流程。", "说明正文": "该体征监测设备在床垫下方使用(注意贴有标签的一面朝上),放置在靠近使用人胸腔正下方为宜。放置完成后,连接电源,控制盒绿灯快闪时,可以进行绑定流程。",
"不再提示": "不再提示", "不再提示": "不再提示",
"跳过": "跳过" "跳过": "跳过"
},
"蓝牙绑定":{
"标题":"蓝牙绑定",
"扫描":"扫描蓝牙设备中…",
"信号":"最小信号强度",
"搜索提示":"检索设备",
"搜索":"搜索",
"匹配":"匹配出的外围设备"
},
"登录页":{
"欢迎使用太和e护":"欢迎使用太和e护",
"科技睡眠 洞悉万千":"科技睡眠 洞悉万千",
"本机号码一键登录/注册":"本机号码一键登录/注册",
"其他手机号码":"其他手机号码",
"协议1":"登录时将自动注册,且代表您同意",
"协议2":"《用户协议》",
"协议3":"和",
"协议4":"《隐私政策》",
"协议5":"以及",
"协议6":"《用户使用条款》",
"其他登录方式":"欢迎使用太和e护"
},
"人员资料":{
"标题":"人员资料",
"保存":"保存",
"名字输入提示":"使用人员姓名",
"生日输入提示":"生日",
"体重输入提示":"体重",
"疾病标题":"慢病管理",
"提示":"提示:填写准确的使用人员相关资料,可以使睡眠报告监测数据更加精准!"
},
"绑定成功":{
"标题":"绑定完成",
"绑定成功":"绑定成功! ",
"分享标题":"是否进行分享?",
"分享内容":"设备绑定成功后,如需对朋友或家人共享我的睡眠情况,可以进行立即分享,分享成功后,对方即可享受查看该设备权限,可以收到该设备的睡眠报告。",
"立即分享":"立即分享",
"返回":"返回首页 开启体验"
} }
} }

View File

@@ -5,7 +5,9 @@ class CustomCard extends StatefulWidget {
final VoidCallback onTap; // 点击回调 final VoidCallback onTap; // 点击回调
final List<Color> colors; // 背景颜色列表 final List<Color> colors; // 背景颜色列表
final Widget child; // 子组件 final Widget child; // 子组件
final String title; final String title; // 标题
final bool enableAnimation; // 是否启用动画效果
final bool enableGradient; // 是否启用渐变
const CustomCard({ const CustomCard({
Key? key, Key? key,
@@ -14,6 +16,8 @@ class CustomCard extends StatefulWidget {
required this.colors, required this.colors,
required this.child, required this.child,
required this.title, required this.title,
this.enableAnimation = true, // 默认启用动画效果
this.enableGradient = true, // 默认启用渐变效果
}) : super(key: key); }) : super(key: key);
@override @override
@@ -60,7 +64,7 @@ class _CustomCardState extends State<CustomCard>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool isGradient = widget.colors.length > 1; final bool isGradient = widget.enableGradient && widget.colors.length > 1; // 只有启用渐变时,才使用渐变
final Color baseColor = widget.colors.first; final Color baseColor = widget.colors.first;
return Material( return Material(
@@ -69,26 +73,42 @@ class _CustomCardState extends State<CustomCard>
child: GestureDetector( child: GestureDetector(
onTapDown: _handleTap, onTapDown: _handleTap,
behavior: HitTestBehavior.translucent, // 关键:让空白区域也能点击 behavior: HitTestBehavior.translucent, // 关键:让空白区域也能点击
child: AnimatedScale( child: widget.enableAnimation // 判断是否启用动画
scale: _scale, ? AnimatedScale(
duration: _animationDuration, scale: _scale,
curve: Curves.easeInOut, duration: _animationDuration,
child: Ink( curve: Curves.easeInOut,
key: _inkKey, child: Ink(
decoration: BoxDecoration( key: _inkKey,
color: isGradient ? null : baseColor, decoration: BoxDecoration(
gradient: isGradient color: isGradient ? null : baseColor,
? LinearGradient( gradient: isGradient
colors: widget.colors, ? LinearGradient(
begin: Alignment.topLeft, colors: widget.colors,
end: Alignment.bottomRight, begin: Alignment.topLeft,
) end: Alignment.bottomRight,
: null, )
borderRadius: BorderRadius.circular(widget.borderRadius), : null,
), borderRadius: BorderRadius.circular(widget.borderRadius),
child: widget.child, ),
), child: widget.child,
), ),
)
: Ink(
key: _inkKey,
decoration: BoxDecoration(
color: isGradient ? null : baseColor,
gradient: isGradient
? LinearGradient(
colors: widget.colors,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
)
: null,
borderRadius: BorderRadius.circular(widget.borderRadius),
),
child: widget.child,
),
), ),
); );
} }

View File

@@ -34,7 +34,9 @@ class UserInfoModel {
User? superbase_user; User? superbase_user;
String? img_bucket = 'user'; String? img_bucket = 'user';
int? login = 0; //是否登录0未登录 1已登录 int? login = 0;
bool? register_agree = false; //注册协议
UserInfoModel(); UserInfoModel();
static UserInfoModel fromJson(Map<String, dynamic> json) => static UserInfoModel fromJson(Map<String, dynamic> json) =>

View File

@@ -19,7 +19,8 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
..deviceModel = json['deviceModel'] as String? ..deviceModel = json['deviceModel'] as String?
..appVersion = json['appVersion'] as String? ..appVersion = json['appVersion'] as String?
..img_bucket = json['img_bucket'] as String? ..img_bucket = json['img_bucket'] as String?
..login = (json['login'] as num?)?.toInt(); ..login = (json['login'] as num?)?.toInt()
..register_agree = json['register_agree'] as bool?;
Map<String, dynamic> _$UserInfoModelToJson(UserInfoModel instance) => Map<String, dynamic> _$UserInfoModelToJson(UserInfoModel instance) =>
<String, dynamic>{ <String, dynamic>{
@@ -33,4 +34,5 @@ Map<String, dynamic> _$UserInfoModelToJson(UserInfoModel instance) =>
'appVersion': instance.appVersion, 'appVersion': instance.appVersion,
'img_bucket': instance.img_bucket, 'img_bucket': instance.img_bucket,
'login': instance.login, 'login': instance.login,
'register_agree': instance.register_agree,
}; };

View File

@@ -3,7 +3,7 @@ import 'package:json_annotation/json_annotation.dart';
@JsonSerializable() @JsonSerializable()
class CustomThemeColor { class CustomThemeColor {
final String color1;// final String color1; //
final String color2; final String color2;
final String color3; final String color3;
final String color4; final String color4;
@@ -78,25 +78,25 @@ class CustomThemeColor {
//浅色模式 //浅色模式
static final light = CustomThemeColor( static final light = CustomThemeColor(
color1: '#FFFFFF', color1: '#45D989',
color2: "#f7f8fa", color2: "#00C1AA",
color3: "#4AD8FA", color3: "#333333",
color4: "#4AD8FA", color4: "#D3D3D3",
color5: "#4AD8FA", color6: "#FBF5D5",
color6: "#4AD8FA", color5: "#FFFFFF006",
color7: "#333333", color7: "#00C1AA",
color8: "#333333", color8: "#FF9F66",
color9: "#333333", color9: "#FF7159",
color10: "#f7f8fa", color10: "#E60012",
color11: "#f7f8fa", color11: "#00C1AA",
color12: "#DBF8FD", color12: "#10CFF1",
color13: "#d3d3d3", color13: "#FF9F66",
color14: "#333333", color14: "#FF7159",
color15: "#FF7159", color15: "#F6F6F6",
color16: "#d3d3d3", color16: "#333333",
color17: "#FFFFFF", color17: "#FFFFFF",
color18: "#4AD8FA", color18: "#FFFFFF",
color19: "#4AD8FA", color19: "#FFFFFF",
color20: "#f7f8fa", color20: "#f7f8fa",
color21: "#5EE00A", color21: "#5EE00A",
color25: "#FF7159", color25: "#FF7159",
@@ -114,25 +114,25 @@ class CustomThemeColor {
color40: "#333333"); color40: "#333333");
//深色模式 //深色模式
static final dark = CustomThemeColor( static final dark = CustomThemeColor(
color1: '#242835', color1: '#45D989',
color2: "#f7f8fa", color2: "#00C1AA",
color3: "#4AD8FA", color3: "#FFFFFF",
color4: "#4AD8FA", color4: "#999999",
color5: "#4AD8FA", color5: "#FFFFFF06",
color6: "#4AD8FA", color6: "#FBF5D5",
color7: "#333333", color7: "#00C1AA",
color8: "#333333", color8: "#FF9F66",
color9: "#333333", color9: "#FF7159",
color10: "#f7f8fa", color10: "#E60012",
color11: "#f7f8fa", color11: "#00C1AA",
color12: "#DBF8FD", color12: "#10CFF1",
color13: "#d3d3d3", color13: "#FF9F66",
color14: "#333333", color14: "#FF7159",
color15: "#FF7159", color15: "#161B28",
color16: "#d3d3d3", color16: "#FFFFFF",
color17: "#FFFFFF", color17: "#242835",
color18: "#4AD8FA", color18: "#EAEAEA",
color19: "#4AD8FA", color19: "#FFFFFF",
color20: "#f7f8fa", color20: "#f7f8fa",
color21: "#5EE00A", color21: "#5EE00A",
color25: "#FF7159", color25: "#FF7159",
@@ -199,6 +199,14 @@ class CustomThemeColor {
if (color.length == 6) { if (color.length == 6) {
color = "0xFF$color"; color = "0xFF$color";
} else if (color.length == 8) {
String alphaHex = color.substring(6, 8);
String rgbHex = color.substring(0, 6);
int alphaInt = int.parse(alphaHex);
double alpha = alphaInt / 100.0;
return Color(int.parse("0xFF$rgbHex")).withOpacity(alpha);
} else { } else {
color = "0x$color"; color = "0x$color";
} }

View File

@@ -124,16 +124,20 @@ class _EPageState extends State<DeviceTypePage> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.sizeOf(context).height * height: (MediaQuery.sizeOf(context).width) *
0.26, 0.13,
constraints: BoxConstraints( constraints: BoxConstraints(
minHeight: 421.rpx, minHeight: 200.rpx,
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius:
BorderRadius.circular(20.rpx), BorderRadius.circular(20.rpx),
child: Image.network( // child: Image.network(
'https://picsum.photos/seed/861/600', // 'https://picsum.photos/seed/861/600',
// fit: BoxFit.cover,
// ),
child: Image.asset(
"assets/img/help_op.png",
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@@ -159,12 +163,52 @@ class _EPageState extends State<DeviceTypePage> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: [ children: [
Icon( Theme(
Icons.arrow_back, data: ThemeData(
color: FlutterFlowTheme.of(context) checkboxTheme: CheckboxThemeData(
.primaryText, visualDensity:
size: 24.rpx, VisualDensity.compact,
), materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(64),
),
),
unselectedWidgetColor:
Color(0xFFD3D3D3),
),
child: Obx(
() => Checkbox(
value: userInfoController
.model.register_agree ??
false,
onChanged: (newValue) async {
userInfoController.model
.register_agree =
newValue;
userInfoController
.updateAll();
// 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取
// if (newValue == true) {
// Deviceconfig
// .initPlatformState();
// }
},
side: BorderSide(
width: 1.5,
color: FlutterFlowTheme.of(
context)
.secondaryText,
),
activeColor:
stringToColor("#16C89F"),
checkColor:
FlutterFlowTheme.of(context)
.info,
),
)),
Text( Text(
'绑定引导.不再提示'.tr, '绑定引导.不再提示'.tr,
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
@@ -182,12 +226,13 @@ class _EPageState extends State<DeviceTypePage> {
borderRadius: 50.rpx, borderRadius: 50.rpx,
onTap: () async { onTap: () async {
await Future.delayed( await Future.delayed(
Duration(seconds: 1)); Duration(milliseconds: 500));
Get.back(); // 关闭当前弹窗或页面 Get.back(); // 关闭当前弹窗或页面
}, },
colors: [ colors: [
Colors.yellow, //todo 颜色
Colors.green stringToColor("45D989"),
stringToColor("00C1AA")
], // 单色背景也用渐变写法 ], // 单色背景也用渐变写法
title: '', title: '',
child: Container( child: Container(
@@ -250,7 +295,7 @@ class _EPageState extends State<DeviceTypePage> {
backgroundColor: stringToColor("#242835"), backgroundColor: stringToColor("#242835"),
// backgroundColor: Colors.transparent, // backgroundColor: Colors.transparent,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
// iconTheme: IconThemeData(color: Colors.white), iconTheme: IconThemeData(color: Colors.white),
titleSpacing: 0, titleSpacing: 0,
// leading: returnIconButtom, // leading: returnIconButtom,
title: Container( title: Container(
@@ -283,6 +328,7 @@ class _EPageState extends State<DeviceTypePage> {
actions: [], actions: [],
centerTitle: false, centerTitle: false,
), ),
body: SafeArea( body: SafeArea(
top: true, top: true,
child: Padding( child: Padding(
@@ -295,16 +341,19 @@ class _EPageState extends State<DeviceTypePage> {
context, context,
title: '设备类型.体征监测设备'.tr, title: '设备类型.体征监测设备'.tr,
imageUrl: 'assets/img/device.png', imageUrl: 'assets/img/device.png',
type: '1',
), ),
_buildDeviceCard( _buildDeviceCard(
context, context,
title: '设备类型.智能床/床垫'.tr, title: '设备类型.智能床/床垫'.tr,
imageUrl: 'assets/img/bed.png', imageUrl: 'assets/img/bed.png',
type: '2',
), ),
_buildDeviceCard( _buildDeviceCard(
context, context,
title: '设备类型.摄像头'.tr, title: '设备类型.摄像头'.tr,
imageUrl: 'assets/img/camera.png', imageUrl: 'assets/img/camera.png',
type: '3',
), ),
] ]
.divide(SizedBox(height: 26.rpx)) .divide(SizedBox(height: 26.rpx))
@@ -321,14 +370,18 @@ class _EPageState extends State<DeviceTypePage> {
} }
Widget _buildDeviceCard(BuildContext context, Widget _buildDeviceCard(BuildContext context,
{required String title, required String imageUrl}) { {required String title, required String imageUrl, required String type}) {
return CustomCard( return CustomCard(
borderRadius: 20.rpx, // 圆角大小 borderRadius: 20.rpx, // 圆角大小
onTap: () { onTap: () {
print('点击了 $title'); if (type != null) {
if (type == '1') {
Get.toNamed("/blueteethDevice");
}
}
}, },
// colors: [Colors.white.withOpacity(0.06)], // 背景色 // colors: [Colors.white.withOpacity(0.06)], // 背景色
colors: [stringToColor("45D989"), stringToColor("00C1AA")], // 背景色 colors: [stringToColor("#242835")], // 背景色
title: title, title: title,
child: Container( child: Container(
width: double.infinity, width: double.infinity,

View File

@@ -1,7 +1,12 @@
import 'package:ef/ef.dart'; import 'package:ef/ef.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.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:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/controller/user_info_controller.dart';
@@ -19,258 +24,527 @@ class _EPageState extends State<LoginPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return LayoutBuilder( return LayoutBuilder(
builder: (context, boxConstraints) => GestureDetector( builder: (context, bodysize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(), onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold( child: Container(
body: SafeArea( decoration: BoxDecoration(
top: true, image: DecorationImage(
child: Column( image: AssetImage('assets/img/bgImage.png'), // 本地图片
mainAxisSize: MainAxisSize.max, fit: BoxFit.fill, // 填满整个 Container
children: [ ),
Expanded( ),
child: SingleChildScrollView( child: Scaffold(
child: Column( backgroundColor: Colors.transparent,
mainAxisSize: MainAxisSize.max, body: SafeArea(
children: [ top: true,
Container( child: Padding(
width: double.infinity, padding:
decoration: BoxDecoration(), EdgeInsetsDirectional.fromSTEB(75.rpx, 0.rpx, 75.rpx, 0),
child: Align( child: Column(
alignment: AlignmentDirectional(-1, 0), mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
SizedBox(
height: 66.rpx,
),
ClickableContainer(
backgroundColor: Colors.transparent, // 容器背景色
highlightColor: Colors.green, // 点击时的背景色
padding:
EdgeInsets.zero, // 这里去掉外部的 padding避免影响点击范围
onTap: () {
Get.back();
},
child: Padding( child: Padding(
padding: EdgeInsetsDirectional.fromSTEB( padding: EdgeInsetsDirectional.fromSTEB(
35.rpx, 66.rpx, 0, 0), 16.rpx, 10.rpx, 16.rpx, 10.rpx),
child: Icon( child: SvgPicture.asset(
Icons.arrow_back, 'assets/img/icon/close.svg',
color: FlutterFlowTheme.of(context).primaryText, width: 25.rpx,
size: 24.rpx, height: 25.rpx, // 如果 SVG 中没有固定颜色,使用 color 设置
color: Colors.white, // 这里设置了颜色
), ),
), ),
), ),
), ],
Align( ),
alignment: AlignmentDirectional(-1, 0), Expanded(
child: Padding( child: SingleChildScrollView(
padding: EdgeInsetsDirectional.fromSTEB( child: Column(
0, 141.rpx, 0, 0), mainAxisSize: MainAxisSize.max,
child: Container( children: [
width: double.infinity, // ClickableContainer(
decoration: BoxDecoration(), // backgroundColor: Colors.transparent, // 容器背景色为透明
child: Align( // highlightColor: Colors.pink, // 点击时背景色也为透明
alignment: AlignmentDirectional(0, 0), // padding: EdgeInsets.all(0), // 没有额外的内边距
child: Text( // onTap: () {
'欢迎使用太和e护', // // 你可以在这里定义点击事件的回调,比如关闭页面等
style: FlutterFlowTheme.of(context) // print('关闭按钮被点击');
.bodyMedium // },
.override( // borderRadius: 0, // 没有圆角
fontFamily: 'Inter', // child: Container(
fontSize: 48.rpx, // // color: Colors.red,
letterSpacing: 0.0, // // width: double.infinity, // 使容器宽度充满父容器
// child: Align(
// alignment:
// AlignmentDirectional(-1, 0), // 左对齐
// child: Padding(
// padding: EdgeInsetsDirectional.fromSTEB(
// 0, 66.rpx, 0, 0),
// child: SvgPicture.asset(
// 'assets/img/icon/close.svg',
// width: 25.rpx,
// height: 25
// .rpx, // 如果 SVG 中没有固定颜色,使用 color 设置
// color: Colors.white, // 这里设置了颜色
// ),
// ),
// ),
// ),
// ),
Align(
alignment: AlignmentDirectional(-1, 0),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0, 141.rpx, 0, 0),
child: Container(
width: double.infinity,
decoration: BoxDecoration(),
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'登录页.欢迎使用太和e护'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: 48.rpx,
letterSpacing: 0.0,
//todo 颜色
color: stringToColor("#FFFFFF"),
),
), ),
),
),
), ),
), ),
), Align(
), alignment: AlignmentDirectional(-1, 0),
), child: Padding(
Align( padding: EdgeInsetsDirectional.fromSTEB(
alignment: AlignmentDirectional(-1, 0), 0, 15.rpx, 0, 0),
child: Padding( child: Container(
padding: width: double.infinity,
EdgeInsetsDirectional.fromSTEB(0, 15.rpx, 0, 0), decoration: BoxDecoration(),
child: Container( child: Align(
width: double.infinity, alignment: AlignmentDirectional(0, 0),
decoration: BoxDecoration(), child: Text(
child: Align( '登录页.科技睡眠 洞悉万千'.tr,
alignment: AlignmentDirectional(0, 0), style: FlutterFlowTheme.of(context)
child: Text( .bodyMedium
'科技睡眠 洞悉万千', .override(
style: FlutterFlowTheme.of(context) fontFamily: 'Inter',
.bodyMedium fontSize: 30.rpx,
.override( letterSpacing: 0.0,
fontFamily: 'Inter', //todo 颜色
fontSize: 30.rpx, color: stringToColor("#FFFFFF"),
letterSpacing: 0.0, ),
), ),
),
),
), ),
), ),
), Align(
), alignment: AlignmentDirectional(-1, 0),
), child: Padding(
Align( padding: EdgeInsetsDirectional.fromSTEB(
alignment: AlignmentDirectional(-1, 0), 0, 95.rpx, 0, 0),
child: Padding( child: Container(
padding: width: double.infinity,
EdgeInsetsDirectional.fromSTEB(0, 95.rpx, 0, 0), decoration: BoxDecoration(),
child: Container( child: Align(
width: double.infinity, alignment: AlignmentDirectional(0, 0),
decoration: BoxDecoration(), child: Text(
child: Align( '139****0733',
alignment: AlignmentDirectional(0, 0), style: FlutterFlowTheme.of(context)
child: Text( .bodyMedium
'139****0733', .override(
style: FlutterFlowTheme.of(context) fontFamily: 'Inter',
.bodyMedium fontSize: 48.rpx,
.override( letterSpacing: 0.0,
fontFamily: 'Inter', //todo 颜色
fontSize: 48.rpx, color: stringToColor("#FFFFFF"),
letterSpacing: 0.0, ),
), ),
),
),
), ),
), ),
), Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0, 35.rpx, 0, 0),
child: CustomCard(
borderRadius: AppConstants()
.button_container_radius, // 圆角半径
onTap: () {
print('Button pressed ...');
// Get.toNamed("/deviceType");
},
colors: [
//todo 颜色
stringToColor("45D989"),
stringToColor("00C1AA")
], // 渐变色是同一个色,也可以根据需要调整
title:
'首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
child: Container(
width:
// MediaQuery.sizeOf(context).width * 0.66,
bodysize.maxWidth,
height: MediaQuery.sizeOf(context).height *
0.055,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
// Icon(
// Icons.arrow_back,
// color: FlutterFlowTheme.of(context)
// .primaryText,
// size: 28.rpx,
// ),
Text(
'登录页.本机号码一键登录/注册'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
//todo 颜色
color: Colors.white,
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(
width: 17.rpx,
)),
),
),
),
),
// ClickableContainer(
// backgroundColor: Colors.transparent, // 背景色(透明)
// highlightColor: stringToColor(
// "#FF6347"), // 点击时的背景色,可以根据需求设置颜色
// padding: EdgeInsetsDirectional.fromSTEB(
// 0, 32.rpx, 0, 32.rpx), // 内部间距
// onTap: () {
// print('点击了“其他手机号码”'); // 点击后的回调事件
// // 这里可以放置点击后的逻辑,比如导航等
// },
// borderRadius: 0.rpx, // 可选的圆角参数,默认是 20.rpx
// child: Align(
// alignment: AlignmentDirectional(-1, 0),
// child: Container(
// width: double.infinity,
// decoration: BoxDecoration(),
// child: Align(
// alignment: AlignmentDirectional(0, 0),
// child: Text(
// '登录页.其他手机号码'.tr,
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color: stringToColor("#FFFFFF"),
// ),
// ),
// ),
// ),
// ),
// ),
SizedBox(
height: 20.rpx,
),
ClickableContainer(
backgroundColor: Colors.transparent, // 容器背景色
highlightColor: Colors.orange, // 点击时的背景色
padding: EdgeInsetsDirectional.fromSTEB(
16.rpx, 10.rpx, 16.rpx, 10.rpx),
onTap: () {
print('点击了容器');
},
child: Text(
'登录页.其他手机号码'.tr, // 子组件内容
style: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
color: Colors.white,
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
25.rpx, 136.rpx, 25.rpx, 50.rpx),
child: Container(
width: double.infinity,
decoration: BoxDecoration(),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// SvgPicture.asset(
// 'assets/img/icon/tick.svg',
// width: 30.rpx,
// height: 30.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
// //todo 颜色
// // color: Colors.white,
// color: Colors.white,
// ),
Theme(
data: ThemeData(
checkboxTheme: CheckboxThemeData(
visualDensity:
VisualDensity.compact,
materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(64),
),
),
unselectedWidgetColor:
Color(0xFFD3D3D3),
),
child: Obx(
() => Checkbox(
value: userInfoController
.model.register_agree ??
false,
onChanged: (newValue) async {
userInfoController.model
.register_agree = newValue;
userInfoController.updateAll();
// 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取
// if (newValue == true) {
// Deviceconfig
// .initPlatformState();
// }
},
side: BorderSide(
width: 1.5,
color:
FlutterFlowTheme.of(context)
.secondaryText,
),
activeColor:
stringToColor("#FF9F66"),
checkColor:
FlutterFlowTheme.of(context)
.info,
),
)),
Expanded(
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(
0.rpx, 10.rpx, 0.rpx, 0.rpx),
child: Container(
width: bodysize.maxWidth,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '登录页.协议1'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: Colors
.white, // 可以调整为你想要的颜色
),
),
TextSpan(
text: '登录页.协议2'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: stringToColor(
"#FF9F66"),
),
),
TextSpan(
text: '登录页.协议3'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: Colors
.white, // 可以调整为你想要的颜色
),
),
TextSpan(
text: '登录页.协议4'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: stringToColor(
"#FF9F66"),
),
),
TextSpan(
text: '登录页.协议5'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: Colors
.white, // 可以调整为你想要的颜色
),
),
TextSpan(
text: '登录页.协议6'.tr,
style: FlutterFlowTheme.of(
context)
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 26.rpx,
color: stringToColor(
"#FF9F66"),
),
),
],
),
),
),
),
),
].divide(SizedBox(width: 18.rpx)),
),
),
),
],
), ),
), ),
Padding( ),
padding: Container(
EdgeInsetsDirectional.fromSTEB(0, 35.rpx, 0, 0), width: double.infinity,
child: Container( height: MediaQuery.sizeOf(context).height * 0.136,
width: MediaQuery.sizeOf(context).width * 0.8, constraints: BoxConstraints(
height: MediaQuery.sizeOf(context).height * 0.055, minHeight: 220.rpx,
constraints: BoxConstraints( ),
minWidth: 500.rpx, decoration: BoxDecoration(),
minHeight: 90.rpx, child: Column(
), mainAxisSize: MainAxisSize.max,
decoration: BoxDecoration( children: [
color: Color(0xFFF01515), Padding(
borderRadius: BorderRadius.circular(50.rpx), padding: EdgeInsetsDirectional.fromSTEB(
), 0, 0, 0, 36.rpx),
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text( child: Text(
'本机号码一键登录/注册', '登录页.其他登录方式'.tr,
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: 26.rpx, fontSize: 26.rpx,
letterSpacing: 0.0, letterSpacing: 0.0,
//todo 颜色
color: stringToColor("#FFFFFF"),
), ),
), ),
), ),
), Row(
),
Align(
alignment: AlignmentDirectional(-1, 0),
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(0, 32.rpx, 0, 0),
child: Container(
width: double.infinity,
decoration: BoxDecoration(),
child: Align(
alignment: AlignmentDirectional(0, 0),
child: Text(
'其他手机号码',
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
),
),
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
110.rpx, 136.rpx, 110.rpx, 0),
child: Container(
width: double.infinity,
decoration: BoxDecoration(),
child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Icon( Container(
Icons.arrow_back, width: 91.rpx,
color: height: 91.rpx,
FlutterFlowTheme.of(context).primaryText, clipBehavior: Clip.antiAlias,
size: 24.rpx, decoration: BoxDecoration(
), shape: BoxShape.circle,
Expanded( ),
// 👈 让文本自动换行 child: Image.asset(
child: Text( "assets/img/wechat.png",
'登录时将自动注册,且代表您同意《用户协议》和 《隐私政策》以及《用户使用条款》', width: 30.rpx,
style: FlutterFlowTheme.of(context) height: 30.rpx,
.bodyMedium
.override(
fontFamily: 'Inter',
letterSpacing: 0.0,
fontSize: 24.rpx, // 可选:字体稍小点更适配
),
), ),
), ),
].divide(SizedBox(width: 26.rpx)), Container(
), width: 91.rpx,
), height: 91.rpx,
), clipBehavior: Clip.antiAlias,
], decoration: BoxDecoration(
), shape: BoxShape.circle,
),
),
Container(
width: double.infinity,
height: MediaQuery.sizeOf(context).height * 0.136,
constraints: BoxConstraints(
minHeight: 220.rpx,
),
decoration: BoxDecoration(),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding:
EdgeInsetsDirectional.fromSTEB(0, 0, 0, 36.rpx),
child: Text(
'其他登录方式',
style:
FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: 'Inter',
fontSize: 26.rpx,
letterSpacing: 0.0,
), ),
child: Image.asset(
"assets/img/tel.png",
width: 30.rpx,
height: 30.rpx,
),
),
Container(
width: 91.rpx,
height: 91.rpx,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Image.asset(
"assets/img/google.png",
width: 30.rpx,
height: 30.rpx,
),
),
].divide(SizedBox(width: 35.rpx)),
),
],
), ),
), ),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 91.rpx,
height: 91.rpx,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Image.network(
'https://picsum.photos/seed/301/600',
fit: BoxFit.cover,
),
),
Container(
width: 91.rpx,
height: 91.rpx,
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: Image.network(
'https://picsum.photos/seed/301/600',
fit: BoxFit.cover,
),
),
].divide(SizedBox(width: 35.rpx)),
),
], ],
), ),
), ),
], ),
), ),
), )),
),
),
); );
} }
} }

View File

@@ -1,9 +1,11 @@
import 'package:ef/ef.dart'; import 'package:ef/ef.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
@@ -25,145 +27,98 @@ class _HomePageState extends State<HomePage> {
return LayoutBuilder( return LayoutBuilder(
builder: (context, bodySize) => GestureDetector( builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(), onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold( child: Container(
// appBar: AppBar( decoration: BoxDecoration(
// backgroundColor: AppColors.bg_color, image: DecorationImage(
// automaticallyImplyLeading: false, image: AssetImage('assets/img/bgImage.png'), // 本地图片
// title: Container( fit: BoxFit.fill, // 填满整个 Container
// width: double.infinity, ),
// height: 70.rpx, ),
// child: Obx( child: Scaffold(
// () => InkWell( backgroundColor: Colors.transparent,
// onTap: () { body: SafeArea(
// Get.toNamed("/editUserInfoPage"); top: true,
// }, // child: Text("首页"),
// child: Row( child: Container(
// mainAxisSize: MainAxisSize.max, height: bodySize.maxHeight,
// mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Padding(
// children: [ padding: EdgeInsetsDirectional.fromSTEB(
// Row( AppConstants().main_left_right_padding,
// mainAxisSize: MainAxisSize.max, 47.rpx,
// children: [ AppConstants().main_left_right_padding,
// Container( 0),
// width: 56.rpx, child: SingleChildScrollView(
// height: 56.rpx, child: Column(
// clipBehavior: Clip.antiAlias, crossAxisAlignment: CrossAxisAlignment.start,
// decoration: BoxDecoration( mainAxisSize: MainAxisSize.max,
// shape: BoxShape.circle, children: [
// ), Padding(
// ), padding: EdgeInsetsDirectional.fromSTEB(
// Container( AppConstants().content_left_right_padding,
// width: 20.rpx, 0,
// height: 0, AppConstants().content_left_right_padding,
// decoration: BoxDecoration( 0),
// color: Colors.white, child: Container(
// shape: BoxShape.rectangle,
// ),
// ),
// Text(
// userInfoController.model.user!.nickName ?? '匿名',
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Readex Pro',
// color: Colors.white,
// letterSpacing: 0,
// fontSize: 30.rpx),
// ),
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// actions: [],
// centerTitle: false,
// ),
body: SafeArea(
top: true,
// child: Text("首页"),
child: Container(
height: bodySize.maxHeight,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/img/bgImage.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
),
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
AppConstants().main_left_right_padding,
47.rpx,
AppConstants().main_left_right_padding,
0),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
AppConstants().content_left_right_padding,
0,
AppConstants().content_left_right_padding,
0),
child: Container(
width: double.infinity,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomCard(
borderRadius: 20.rpx,
onTap: () async {
Get.toNamed("/loginPage");
},
title: '首页.登录'
.tr, // 虽然 title 传入了,但当前组件里没用它(可忽略或用于调试)
colors: [
stringToColor("#45D989"),
stringToColor("#00C1AA"),
],
child: Container(
width: 100.rpx,
height: 60.rpx,
alignment: Alignment.center,
padding: EdgeInsetsDirectional.fromSTEB(
16.rpx, 0, 16.rpx, 0),
child: Text(
'首页.登录'.tr,
style: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily: 'Inter Tight',
color: Colors.white,
letterSpacing: 0.0,
),
),
),
),
Icon(
Icons.add_circle_outline_outlined,
color: FlutterFlowTheme.of(context).primaryText,
size: 38.rpx,
),
// Lottie.asset(
// 'assets/img/loading.json',
// width: 200,
// height: 200,
// fit: BoxFit.contain,
// )
],
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
19.rpx, 13.rpx, 0, 13.rpx),
child: Container(
width: double.infinity, width: double.infinity,
child: Row( child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomCard(
borderRadius: 20.rpx,
onTap: () async {
Get.toNamed("/loginPage");
},
title: '首页.登录'
.tr, // 虽然 title 传入了,但当前组件里没用它(可忽略或用于调试)
colors: [
themeController.currentColor.sc1,
themeController.currentColor.sc2,
],
child: Container(
width: 100.rpx,
height: 60.rpx,
alignment: Alignment.center,
padding: EdgeInsetsDirectional.fromSTEB(
16.rpx, 0, 16.rpx, 0),
child: Text(
'首页.登录'.tr,
style: FlutterFlowTheme.of(context)
.titleSmall
.override(
fontFamily: 'Inter Tight',
color: themeController
.currentColor.sc19,
letterSpacing: 0.0,
),
),
),
),
SvgPicture.asset(
'assets/img/icon/add.svg',
width: 39.rpx,
height: 39.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
//todo 颜色
color: themeController.currentColor.sc16,
),
],
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
19.rpx, 34.rpx, 0, 21.rpx),
child: ClickableContainer(
backgroundColor: Colors.transparent, // 容器背景色
highlightColor: Colors.orange, // 点击时的背景色
onTap: () {
print('点击了容器');
},
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 10.rpx, 0, 10.rpx),
child: Container(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
'首页.已关联体征监测设备'.tr, '首页.已关联体征监测设备'.tr,
@@ -174,10 +129,12 @@ class _HomePageState extends State<HomePage> {
fontSize: fontSize:
AppConstants().title_text_fontSize, AppConstants().title_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
//todo 颜色
color: themeController.currentColor.sc3,
), ),
), ),
Text( Text(
' 0', '0',
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
@@ -185,188 +142,124 @@ class _HomePageState extends State<HomePage> {
fontSize: fontSize:
AppConstants().title_text_fontSize, AppConstants().title_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
color: themeController.currentColor.sc8,
), ),
), ),
], ].divide(SizedBox(
width: 6.rpx,
)),
)), )),
), ),
Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 0.277,
constraints: BoxConstraints(
minWidth: 690.rpx,
minHeight: 450.rpx,
), ),
decoration: BoxDecoration( Container(
color: stringToColor("#242835"),
borderRadius: BorderRadius.circular(
AppConstants().normal_container_radius), // 圆角半径
),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: MediaQuery.sizeOf(context).width * 0.66,
height: MediaQuery.sizeOf(context).height * 0.055,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.red, Colors.orange], // 渐变颜色数组
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(
AppConstants()
.button_container_radius), // 圆角半径
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.arrow_back,
color: FlutterFlowTheme.of(context)
.primaryText,
size: 28.rpx,
),
Text(
'首页.扫一扫绑定'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(
width: 17.rpx,
)),
),
),
CustomCard(
borderRadius: AppConstants()
.button_container_radius, // 圆角半径
onTap: () {
print('Button pressed ...');
Get.toNamed("/deviceType");
},
colors: [
stringToColor("45D989"),
stringToColor("00C1AA")
], // 渐变色是同一个色,也可以根据需要调整
title: '首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
child: Container(
width: MediaQuery.sizeOf(context).width * 0.66,
height:
MediaQuery.sizeOf(context).height * 0.055,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.arrow_back,
color: FlutterFlowTheme.of(context)
.primaryText,
size: 28.rpx,
),
Text(
'首页.蓝牙绑定'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(
width: 17.rpx,
)),
),
),
)
],
),
),
Padding(
padding:
EdgeInsetsDirectional.fromSTEB(0, 26.rpx, 0, 0),
child: Container(
width: MediaQuery.sizeOf(context).width, width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 0.277,
constraints: BoxConstraints(
minWidth: 690.rpx,
minHeight: 450.rpx,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFBF5D5), color: themeController.currentColor.sc5,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
AppConstants().normal_container_radius), // 圆角半径 AppConstants().normal_container_radius), // 圆角半径
), ),
child: Padding( child: Column(
padding: EdgeInsetsDirectional.fromSTEB( mainAxisSize: MainAxisSize.max,
25.rpx, 25.rpx, 25.rpx, 25.rpx), mainAxisAlignment: MainAxisAlignment.center,
child: Row( children: [
mainAxisSize: MainAxisSize.max, CustomCard(
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: AppConstants()
children: [ .button_container_radius, // 圆角半径
Icon( onTap: () {
Icons.volume_mute, Get.toNamed("/personPage");
color: },
FlutterFlowTheme.of(context).primaryText, colors: [
size: 30.rpx, // 渐变色
), themeController.currentColor.sc1,
Expanded( themeController.currentColor.sc2,
child: Column( ],
title:
'首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
child: Container(
width:
MediaQuery.sizeOf(context).width * 0.66,
height:
MediaQuery.sizeOf(context).height * 0.055,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
CrossAxisAlignment.start,
children: [ children: [
Text( SvgPicture.asset(
'首页.提示标题'.tr, 'assets/img/icon/scan.svg',
style: FlutterFlowTheme.of(context) width: 25.rpx,
.bodyMedium height: 25.rpx, // SVG 的固定大小
.override( color: themeController
fontFamily: 'Inter', .currentColor.sc16, // 颜色设置
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
fontWeight: FontWeight.w500,
color: Colors.orange),
), ),
Text( Text(
'首页.提示内容1'.tr, '首页.扫一扫绑定'.tr,
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
color: themeController
.currentColor.sc19,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants() fontSize: AppConstants()
.normal_text_fontSize, .normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),
Text( ].divide(SizedBox(width: 17.rpx)),
'首页.提示内容2'.tr, ),
style: FlutterFlowTheme.of(context) ),
.bodyMedium ),
.override( CustomCard(
fontFamily: 'Inter', borderRadius: AppConstants()
fontSize: AppConstants() .button_container_radius, // 圆角半径
.normal_text_fontSize, onTap: () {
letterSpacing: 0.0, print('Button pressed ...');
), Get.toNamed("/deviceType");
},
colors: [
//todo 颜色
themeController.currentColor.sc1,
themeController.currentColor.sc2,
], // 渐变色是同一个色,也可以根据需要调整
title:
'首页.蓝牙绑定'.tr, // 可选,虽然这个 title 没用,但可以作为调试用
child: Container(
width:
MediaQuery.sizeOf(context).width * 0.66,
height:
MediaQuery.sizeOf(context).height * 0.055,
constraints: BoxConstraints(
minWidth: 500.rpx,
minHeight: 90.rpx,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
'assets/img/icon/bluetooth.svg',
width: 25.rpx,
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
//todo 颜色
color:
themeController.currentColor.sc16,
), ),
Text( Text(
'首页.提示内容3'.tr, '首页.蓝牙绑定'.tr,
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
//todo 颜色
color: themeController
.currentColor.sc19,
fontFamily: 'Inter', fontFamily: 'Inter',
fontSize: AppConstants() fontSize: AppConstants()
.normal_text_fontSize, .normal_text_fontSize,
@@ -374,16 +267,115 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
].divide(SizedBox( ].divide(SizedBox(
height: AppConstants() width: 17.rpx,
.text_padding_up_dowm_p)), )),
), ),
) ),
].divide(SizedBox(width: 20.rpx)), )
].divide(SizedBox(
height: 60.rpx,
)),
),
),
Padding(
padding:
EdgeInsetsDirectional.fromSTEB(0, 26.rpx, 0, 0),
child: Container(
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(
color: themeController.currentColor.sc6,
borderRadius: BorderRadius.circular(AppConstants()
.normal_container_radius), // 圆角半径
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
25.rpx, 25.rpx, 25.rpx, 25.rpx),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0.rpx, 5.rpx, 0.rpx, 0.rpx),
child: SvgPicture.asset(
'assets/img/icon/sound.svg',
width: 30.rpx,
height: 30.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
//todo 颜色
color: stringToColor("#FF9F66"),
),
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'首页.提示标题'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
fontWeight: FontWeight.w900,
//todo 配置颜色
color:
stringToColor("#916D46")),
),
Text(
'首页.提示内容1'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
//todo 配置颜色
color:
stringToColor("#916D46")),
),
Text(
'首页.提示内容2'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
//todo 配置颜色
color:
stringToColor("#916D46")),
),
Text(
'首页.提示内容3'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0.0,
//todo 配置颜色
color:
stringToColor("#916D46")),
),
].divide(SizedBox(
height: AppConstants()
.text_padding_up_dowm_p)),
),
)
].divide(SizedBox(width: 20.rpx)),
),
), ),
), ),
), ),
), ],
], ),
), ),
), ),
), ),

View File

@@ -61,7 +61,7 @@ class MainPageBottomChange extends GetView<MainPageController> {
List arr = [ List arr = [
HomePage(), HomePage(),
SleepReportPage(), // SleepReportPage(),
EPage(), EPage(),
MessagePage(), MessagePage(),
MinePage(), MinePage(),
@@ -91,43 +91,10 @@ class MainPageBottomChange extends GetView<MainPageController> {
); );
} else { } else {
return Scaffold( return Scaffold(
backgroundColor: Colors.transparent,
body: arr[controller.model.currentIndex], body: arr[controller.model.currentIndex],
floatingActionButtonAnimator: floatingActionButtonAnimator:
FloatingActionButtonAnimator.noAnimation, FloatingActionButtonAnimator.noAnimation,
// floatingActionButton: Stack(
// alignment: Alignment.center,
// children: [
// Positioned(
// bottom: 10.rpx,
// child: InkWell(
// onTap: () {
// print("index 3");
// if (globalController.model.deviceList.length == 0) {
// showToast("请先绑定设备");
// return;
// }
// if (globalController.model.deviceMain == null ||
// globalController.model.deviceMain["mac"] == null) {
// globalController.model.deviceMain =
// globalController.model.deviceList[0];
// globalController.updateAll();
// }
// controller.model.currentIndex = 2;
// controller.updateAll();
// },
// child: Image.asset(
// gaplessPlayback: true,
// excludeFromSemantics: true,
// controller.model.currentIndex == 2
// ? "assets/images/icon_sleep_light.png"
// : "assets/images/icon_sleep_dark.png",
// width: 120.rpx,
// height: 120.rpx,
// ),
// )),
// ],
// ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked, FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: Theme( bottomNavigationBar: Theme(
@@ -135,17 +102,14 @@ class MainPageBottomChange extends GetView<MainPageController> {
splashFactory: NoSplash.splashFactory, splashFactory: NoSplash.splashFactory,
highlightColor: Colors.transparent), highlightColor: Colors.transparent),
child: BottomNavigationBar( child: BottomNavigationBar(
unselectedItemColor: Colors.white, unselectedItemColor: themeController.currentColor.sc4,
selectedItemColor: stringToColor("#D3B684"), selectedItemColor: themeController.currentColor.sc1,
backgroundColor: themeController.currentColor.sc5, backgroundColor: themeController.currentColor.sc5,
selectedFontSize: 26.rpx, selectedFontSize: 26.rpx,
unselectedFontSize: 26.rpx, unselectedFontSize: 26.rpx,
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
currentIndex: controller.model.currentIndex, currentIndex: controller.model.currentIndex,
onTap: (index) { onTap: (index) {
// if(controller.model.currentIndex == 2) {
// arr[2].closeBefore();
// }
Future.delayed(const Duration(milliseconds: 500), () { Future.delayed(const Duration(milliseconds: 500), () {
if (controller.model.currentIndex != 1) { if (controller.model.currentIndex != 1) {
globalController.model.hideBottomNavigationBar = false; globalController.model.hideBottomNavigationBar = false;
@@ -158,8 +122,8 @@ class MainPageBottomChange extends GetView<MainPageController> {
items: [ items: [
getBottomNavigationBarItem("assets/img/menu/home.svg", getBottomNavigationBarItem("assets/img/menu/home.svg",
"assets/img/menu/n_home.svg", "菜单.首页".tr), "assets/img/menu/n_home.svg", "菜单.首页".tr),
getBottomNavigationBarItem("assets/img/menu/report.svg", // getBottomNavigationBarItem("assets/img/menu/report.svg",
"assets/img/menu/n_report.svg", "菜单.报告".tr), // "assets/img/menu/n_report.svg", "菜单.报告".tr),
getBottomNavigationBarItem("assets/img/menu/e.svg", getBottomNavigationBarItem("assets/img/menu/e.svg",
"assets/img/menu/n_e.svg", "菜单.小e".tr), "assets/img/menu/n_e.svg", "菜单.小e".tr),
getBottomNavigationBarItem("assets/img/menu/message.svg", getBottomNavigationBarItem("assets/img/menu/message.svg",

View File

@@ -1,9 +1,12 @@
import 'package:ef/ef.dart'; import 'package:ef/ef.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.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:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/controller/user_info_controller.dart';
@@ -20,10 +23,52 @@ class _MinePageState extends State<MinePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: stringToColor("#242835"), // 这里设置你希望的颜色
statusBarIconBrightness: Brightness.light, // 状态栏图标的亮度
));
return LayoutBuilder( return LayoutBuilder(
builder: (context, bodySize) => GestureDetector( builder: (context, bodySize) => GestureDetector(
onTap: () => FocusScope.of(context).unfocus(), onTap: () => FocusScope.of(context).unfocus(),
child: Scaffold( child: Scaffold(
// appBar: AppBar(
// backgroundColor: stringToColor("#242835"),
// // backgroundColor: Colors.transparent,
// automaticallyImplyLeading: false,
// // iconTheme: IconThemeData(color: Colors.white),
// titleSpacing: 0,
// // leading: returnIconButtom,
// // title: Container(
// // // color: Colors.grey,
// // width: double.infinity,
// // height: 180.rpx,
// // child: Stack(
// // alignment: Alignment.center,
// // children: [
// // /// 居中标题
// // Text(
// // '设备列表',
// // style: FlutterFlowTheme.of(context).bodyMedium.override(
// // fontFamily: 'Readex Pro',
// // color: Colors.white,
// // letterSpacing: 0,
// // fontSize: 30.rpx,
// // ),
// // ),
// // /// 左边返回按钮
// // Positioned(
// // left: 0,
// // child: returnIconButtom,
// // ),
// // ],
// // ),
// // ),
// actions: [],
// centerTitle: false,
// ),
body: SafeArea( body: SafeArea(
top: true, top: true,
child: Container( child: Container(
@@ -67,11 +112,13 @@ class _MinePageState extends State<MinePage> {
'assets/img/icon/earphone.svg', 'assets/img/icon/earphone.svg',
width: 29.rpx, width: 29.rpx,
height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
), ),
SvgPicture.asset( SvgPicture.asset(
'assets/img/icon/setting.svg', 'assets/img/icon/setting.svg',
width: 29.rpx, width: 29.rpx,
height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 height: 29.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
), ),
].divide(SizedBox(width: 60.rpx)), ].divide(SizedBox(width: 60.rpx)),
), ),
@@ -100,26 +147,28 @@ class _MinePageState extends State<MinePage> {
), ),
Column( Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Hello World', '张天爱',
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: 'Inter', fontFamily: 'Inter',
color: Color(0xFFEFF3F8), color: Colors.white,
fontSize: AppConstants() fontSize: AppConstants()
.normal_text_fontSize, .title_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),
Text( Text(
'Hello World', '账号135****2598',
style: FlutterFlowTheme.of(context) style: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: 'Inter', fontFamily: 'Inter',
color: Color(0xFFEAEFF3), color: stringToColor("#C8C9CC"),
fontSize: AppConstants() fontSize: AppConstants()
.normal_text_fontSize, .normal_text_fontSize,
letterSpacing: 0.0, letterSpacing: 0.0,
@@ -144,10 +193,15 @@ class _MinePageState extends State<MinePage> {
letterSpacing: 0.0, letterSpacing: 0.0,
), ),
), ),
SvgPicture.asset( Padding(
'assets/img/icon/arrow_right.svg', padding: EdgeInsetsDirectional.fromSTEB(
width: 8.rpx, 0, 6.rpx, 0, 0.rpx),
height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 child: SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 14.rpx,
height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
), ),
].divide(SizedBox(width: 16.rpx)), ].divide(SizedBox(width: 16.rpx)),
), ),
@@ -170,195 +224,291 @@ class _MinePageState extends State<MinePage> {
), ),
child: Padding( child: Padding(
padding: EdgeInsetsDirectional.fromSTEB( padding: EdgeInsetsDirectional.fromSTEB(
40.rpx, 0, 40.rpx, 0), 45.rpx, 0, 45.rpx, 0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Row( ClickableContainer(
mainAxisSize: MainAxisSize.max, backgroundColor: Colors.transparent, // 容器背景色
mainAxisAlignment: MainAxisAlignment.spaceBetween, highlightColor: Colors.orange, // 点击时的背景色
children: [ padding: EdgeInsetsDirectional.fromSTEB(
Row( 0.rpx, 0.rpx, 0.rpx, 0.rpx),
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ print('点击了容器');
SvgPicture.asset( },
'assets/img/icon/my_device.svg', child: Container(
width: 25.rpx, child: Padding(
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 padding: EdgeInsetsDirectional.fromSTEB(
), 0.rpx, 20.rpx, 0.rpx, 20.rpx),
Text( child: Row(
'我的.我的设备'.tr, mainAxisSize: MainAxisSize.max,
style: FlutterFlowTheme.of(context) mainAxisAlignment:
.bodyMedium MainAxisAlignment.spaceBetween,
.override( children: [
fontFamily: 'Inter', Row(
color: Color(0xFFE0E2E4), mainAxisSize: MainAxisSize.max,
fontSize: AppConstants() children: [
.title_text_fontSize, SvgPicture.asset(
letterSpacing: 0.0, 'assets/img/icon/my_device.svg',
width: 25.rpx,
height:
25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: stringToColor("#00C1AA"),
), ),
), Text(
].divide(SizedBox(width: 22.rpx)), '我的.我的设备'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
color: Color(0xFFE0E2E4),
fontSize: AppConstants()
.title_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 22.rpx)),
),
SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
],
),
), ),
SvgPicture.asset( ),
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
),
],
), ),
Row( ClickableContainer(
mainAxisSize: MainAxisSize.max, backgroundColor: Colors.transparent, // 容器背景色
mainAxisAlignment: MainAxisAlignment.spaceBetween, highlightColor: Colors.orange, // 点击时的背景色
children: [ padding: EdgeInsetsDirectional.fromSTEB(
Row( 0.rpx, 0.rpx, 0.rpx, 0.rpx),
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ print('点击了容器');
SvgPicture.asset( },
'assets/img/icon/device_repair.svg', child: Container(
width: 25.rpx, child: Padding(
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 padding: EdgeInsetsDirectional.fromSTEB(
), 0.rpx, 20.rpx, 0.rpx, 20.rpx),
Text( child: Row(
'我的.设备报修'.tr, mainAxisSize: MainAxisSize.max,
style: FlutterFlowTheme.of(context) mainAxisAlignment:
.bodyMedium MainAxisAlignment.spaceBetween,
.override( children: [
fontFamily: 'Inter', Row(
color: Color(0xFFE0E2E4), mainAxisSize: MainAxisSize.max,
fontSize: AppConstants() children: [
.title_text_fontSize, SvgPicture.asset(
letterSpacing: 0.0, 'assets/img/icon/device_repair.svg',
width: 25.rpx,
height:
25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: stringToColor("#00C1AA"),
), ),
), Text(
].divide(SizedBox(width: 22.rpx)), '我的.设备报修'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
color: Color(0xFFE0E2E4),
fontSize: AppConstants()
.title_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 22.rpx)),
),
SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
],
),
), ),
SvgPicture.asset( ),
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
),
],
), ),
Row( ClickableContainer(
mainAxisSize: MainAxisSize.max, backgroundColor: Colors.transparent, // 容器背景色
mainAxisAlignment: MainAxisAlignment.spaceBetween, highlightColor: Colors.orange, // 点击时的背景色
children: [ padding: EdgeInsetsDirectional.fromSTEB(
Row( 0.rpx, 0.rpx, 0.rpx, 0.rpx),
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ print('点击了容器');
SvgPicture.asset( },
'assets/img/icon/op_ex.svg', child: Container(
width: 25.rpx, child: Padding(
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 padding: EdgeInsetsDirectional.fromSTEB(
), 0.rpx, 20.rpx, 0.rpx, 20.rpx),
Text( child: Row(
'我的.操作说明'.tr, mainAxisSize: MainAxisSize.max,
style: FlutterFlowTheme.of(context) mainAxisAlignment:
.bodyMedium MainAxisAlignment.spaceBetween,
.override( children: [
fontFamily: 'Inter', Row(
color: Color(0xFFE0E2E4), mainAxisSize: MainAxisSize.max,
fontSize: AppConstants() children: [
.title_text_fontSize, SvgPicture.asset(
letterSpacing: 0.0, 'assets/img/icon/op_ex.svg',
width: 25.rpx,
height:
25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: stringToColor("#00C1AA"),
), ),
), Text(
].divide(SizedBox(width: 22.rpx)), '我的.操作说明'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
color: Color(0xFFE0E2E4),
fontSize: AppConstants()
.title_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 22.rpx)),
),
SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
],
),
), ),
SvgPicture.asset( ),
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
),
],
), ),
Row( ClickableContainer(
mainAxisSize: MainAxisSize.max, backgroundColor: Colors.transparent, // 容器背景色
mainAxisAlignment: MainAxisAlignment.spaceBetween, highlightColor: Colors.orange, // 点击时的背景色
children: [ padding: EdgeInsetsDirectional.fromSTEB(
Row( 0.rpx, 0.rpx, 0.rpx, 0.rpx),
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ print('点击了容器');
SvgPicture.asset( },
'assets/img/icon/like.svg', child: Container(
width: 25.rpx, child: Padding(
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 padding: EdgeInsetsDirectional.fromSTEB(
), 0.rpx, 20.rpx, 0.rpx, 20.rpx),
Text( child: Row(
'关注我们'.tr, mainAxisSize: MainAxisSize.max,
style: FlutterFlowTheme.of(context) mainAxisAlignment:
.bodyMedium MainAxisAlignment.spaceBetween,
.override( children: [
fontFamily: 'Inter', Row(
color: Color(0xFFE0E2E4), mainAxisSize: MainAxisSize.max,
fontSize: AppConstants() children: [
.title_text_fontSize, SvgPicture.asset(
letterSpacing: 0.0, 'assets/img/icon/like.svg',
width: 25.rpx,
height:
25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: stringToColor("#00C1AA"),
), ),
), Text(
].divide(SizedBox(width: 22.rpx)), '关注我们'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
color: Color(0xFFE0E2E4),
fontSize: AppConstants()
.title_text_fontSize,
letterSpacing: 0.0,
),
),
].divide(SizedBox(width: 22.rpx)),
),
SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
],
),
), ),
SvgPicture.asset( ),
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
),
],
), ),
Row( ClickableContainer(
mainAxisSize: MainAxisSize.max, backgroundColor: Colors.transparent, // 容器背景色
mainAxisAlignment: MainAxisAlignment.spaceBetween, highlightColor: Colors.orange, // 点击时的背景色
children: [ padding: EdgeInsetsDirectional.fromSTEB(
Row( 0.rpx, 0.rpx, 0.rpx, 0.rpx),
mainAxisSize: MainAxisSize.max, onTap: () {
children: [ print('点击了容器');
SvgPicture.asset( },
'assets/img/icon/version.svg', child: Container(
width: 25.rpx, child: Padding(
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 padding: EdgeInsetsDirectional.fromSTEB(
), 0.rpx, 20.rpx, 0.rpx, 20.rpx),
Text( child: Row(
'我的.当前版本'.tr, mainAxisSize: MainAxisSize.max,
style: FlutterFlowTheme.of(context) mainAxisAlignment:
.bodyMedium MainAxisAlignment.spaceBetween,
.override( children: [
fontFamily: 'Inter', Row(
color: Color(0xFFE0E2E4), mainAxisSize: MainAxisSize.max,
fontSize: AppConstants() children: [
.title_text_fontSize, SvgPicture.asset(
letterSpacing: 0.0, 'assets/img/icon/version.svg',
width: 25.rpx,
height:
25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: stringToColor("#00C1AA"),
), ),
), Text(
].divide(SizedBox(width: 22.rpx)), '我的.当前版本'.tr,
), style: FlutterFlowTheme.of(context)
Row( .bodyMedium
mainAxisSize: MainAxisSize.max, .override(
children: [ fontFamily: 'Inter',
Text( color: Color(0xFFE0E2E4),
'3.61.0', fontSize: AppConstants()
style: FlutterFlowTheme.of(context) .title_text_fontSize,
.bodyMedium letterSpacing: 0.0,
.override( ),
fontFamily: 'Inter',
color: Color(0xFFD9E3EB),
fontSize: 26.rpx,
letterSpacing: 0.0,
), ),
), ].divide(SizedBox(width: 22.rpx)),
SvgPicture.asset( ),
'assets/img/icon/arrow_right.svg', Row(
width: 8.rpx, mainAxisSize: MainAxisSize.max,
height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 children: [
), Text(
].divide(SizedBox(width: 28.rpx)), '3.61.0',
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
color: Color(0xFFD9E3EB),
fontSize: 26.rpx,
letterSpacing: 0.0,
),
),
SvgPicture.asset(
'assets/img/icon/arrow_right.svg',
width: 8.rpx,
height:
15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
color: Colors.white,
),
].divide(SizedBox(width: 28.rpx)),
),
],
),
), ),
], ),
), ),
] ]
.divide(SizedBox(height: 60.rpx)) .divide(SizedBox(height: 0.rpx))
.addToStart(SizedBox(height: 60.rpx)) .addToStart(SizedBox(height: 30.rpx))
.addToEnd(SizedBox(height: 60.rpx)), .addToEnd(SizedBox(height: 30.rpx)),
), ),
), ),
), ),

View File

@@ -1,4 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:vbvs_app/pages/device_bind/bind_device_success.dart';
import 'package:vbvs_app/pages/device_bind/blueteeth_device_page.dart';
import 'package:vbvs_app/pages/device_bind/device_type.dart'; import 'package:vbvs_app/pages/device_bind/device_type.dart';
import 'package:vbvs_app/pages/login/login.dart'; import 'package:vbvs_app/pages/login/login.dart';
import 'package:vbvs_app/pages/main_bottom/e_page.dart'; import 'package:vbvs_app/pages/main_bottom/e_page.dart';
@@ -7,6 +9,7 @@ import 'package:vbvs_app/pages/main_bottom/main_page_bottom_change.dart';
import 'package:vbvs_app/pages/main_bottom/message_page.dart'; import 'package:vbvs_app/pages/main_bottom/message_page.dart';
import 'package:vbvs_app/pages/main_bottom/mine_page.dart'; import 'package:vbvs_app/pages/main_bottom/mine_page.dart';
import 'package:vbvs_app/pages/main_bottom/sleep_report_page.dart'; import 'package:vbvs_app/pages/main_bottom/sleep_report_page.dart';
import 'package:vbvs_app/pages/person/person_page.dart';
@@ -20,6 +23,9 @@ var routes = {
"/mianPageBottomChange": (contxt) => MainPageBottomChange(), "/mianPageBottomChange": (contxt) => MainPageBottomChange(),
"/loginPage": (contxt) => LoginPage(), "/loginPage": (contxt) => LoginPage(),
"/deviceType": (contxt) => DeviceTypePage(), "/deviceType": (contxt) => DeviceTypePage(),
"/blueteethDevice": (contxt) => BlueteethDevicePage(),
"/personPage": (contxt) => PersonPage(),
"/bindDeviceSuccess": (contxt) => BindDeviceSuccess(),
}; };
//2、配置onGenerateRoute 固定写法 这个方法也相当于一个中间件,这里可以做权限判断 //2、配置onGenerateRoute 固定写法 这个方法也相当于一个中间件,这里可以做权限判断

View File

@@ -8,6 +8,7 @@ import Foundation
import app_links import app_links
import device_info_plus import device_info_plus
import file_picker import file_picker
import flutter_blue_plus_darwin
import flutter_localization import flutter_localization
import flutter_web_auth_2 import flutter_web_auth_2
import package_info_plus import package_info_plus
@@ -23,6 +24,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FlutterBluePlusPlugin.register(with: registry.registrar(forPlugin: "FlutterBluePlusPlugin"))
FlutterLocalizationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalizationPlugin")) FlutterLocalizationPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalizationPlugin"))
FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin")) FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))

View File

@@ -159,6 +159,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.7.0" version: "5.7.0"
bluez:
dependency: transitive
description:
name: bluez
sha256: "61a7204381925896a374301498f2f5399e59827c6498ae1e924aaa598751b545"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.8.3"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@@ -407,6 +415,14 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.16" version: "2.5.16"
dbus:
dependency: transitive
description:
name: dbus
sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.11"
decimal: decimal:
dependency: transitive dependency: transitive
description: description:
@@ -589,6 +605,54 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.5.2" version: "4.5.2"
flutter_blue_plus:
dependency: "direct main"
description:
name: flutter_blue_plus
sha256: "2d926dbef0fd6c58d4be8fca9eaaf1ba747c0ccb8373ddd5386665317e26eb61"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.35.3"
flutter_blue_plus_android:
dependency: transitive
description:
name: flutter_blue_plus_android
sha256: c1d83f84b514e46345a8a58599c428f20b11e78379521e0d3b0611c7b7cbf2c1
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_blue_plus_darwin:
dependency: transitive
description:
name: flutter_blue_plus_darwin
sha256: "8d0a0f11f83b13dda173396b7e4028b4e8656bc8dbbc82c26a7e49aafc62644b"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_blue_plus_linux:
dependency: transitive
description:
name: flutter_blue_plus_linux
sha256: "1d367ed378b2bd6c3b9685fda7044e1d2f169884802b7dec7badb31a99a72660"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_blue_plus_platform_interface:
dependency: transitive
description:
name: flutter_blue_plus_platform_interface
sha256: "114f8e85a03a28a48d707a4df6cc9218e1f2005cf260c5e815e5585a00da5778"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_blue_plus_web:
dependency: transitive
description:
name: flutter_blue_plus_web
sha256: db70cdc41bc743763dc0d47e8c7c10f3923cbbe71b33d9dc21deea482affeb4d
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
flutter_cache_manager: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:
@@ -1214,6 +1278,54 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.2.5" version: "4.2.5"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
sha256: "2d070d8684b68efb580a5997eb62f675e8a885ef0be6e754fb9ef489c177470f"
url: "https://pub.flutter-io.cn"
source: hosted
version: "12.0.0+1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6"
url: "https://pub.flutter-io.cn"
source: hosted
version: "13.0.1"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.4.7"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3+5"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.3.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:

View File

@@ -29,6 +29,8 @@ dependencies:
url: http://admin@git.real.he-info.cn:8080/r/~lu/flutterflow-ui.git url: http://admin@git.real.he-info.cn:8080/r/~lu/flutterflow-ui.git
ref: master ref: master
lottie: ^3.2.0 lottie: ^3.2.0
flutter_blue_plus: ^1.35.3
permission_handler: ^12.0.0+1
dev_dependencies: dev_dependencies:

View File

@@ -8,6 +8,7 @@
#include <app_links/app_links_plugin_c_api.h> #include <app_links/app_links_plugin_c_api.h>
#include <flutter_localization/flutter_localization_plugin_c_api.h> #include <flutter_localization/flutter_localization_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <rive_common/rive_plugin.h> #include <rive_common/rive_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
#include <window_to_front/window_to_front_plugin.h> #include <window_to_front/window_to_front_plugin.h>
@@ -17,6 +18,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("AppLinksPluginCApi")); registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
FlutterLocalizationPluginCApiRegisterWithRegistrar( FlutterLocalizationPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterLocalizationPluginCApi")); registry->GetRegistrarForPlugin("FlutterLocalizationPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
RivePluginRegisterWithRegistrar( RivePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RivePlugin")); registry->GetRegistrarForPlugin("RivePlugin"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(

View File

@@ -5,6 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
app_links app_links
flutter_localization flutter_localization
permission_handler_windows
rive_common rive_common
url_launcher_windows url_launcher_windows
window_to_front window_to_front