321 lines
13 KiB
Dart
321 lines
13 KiB
Dart
import 'package:ef/ef.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.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/MyUtils.dart';
|
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
|
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
|
|
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
|
|
import 'package:vbvs_app/controller/user_info_controller.dart';
|
|
|
|
class BindDeviceSuccess extends StatefulWidget {
|
|
const BindDeviceSuccess({super.key});
|
|
|
|
@override
|
|
State<BindDeviceSuccess> createState() => _EPageState();
|
|
}
|
|
|
|
class _EPageState extends State<BindDeviceSuccess> {
|
|
GlobalController globalController = Get.find();
|
|
UserInfoController userInfoController = Get.find();
|
|
BlueteethBindController blueteethBindController = Get.find();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(
|
|
builder: (context, bodySize) => GestureDetector(
|
|
onTap: () => FocusScope.of(context).unfocus(),
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
|
|
fit: BoxFit.fill, // 填满整个 Container
|
|
),
|
|
),
|
|
child: Scaffold(
|
|
backgroundColor: Colors.transparent, // 加上这一行
|
|
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(
|
|
'绑定成功.标题'.tr,
|
|
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(
|
|
top: true,
|
|
child: Padding(
|
|
padding: EdgeInsetsDirectional.fromSTEB(113.rpx, 0, 113.rpx, 0),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 74.rpx, 0, 0),
|
|
child: Container(
|
|
width: 124.rpx,
|
|
height: 124.rpx,
|
|
// width: double.infinity,
|
|
decoration: BoxDecoration(),
|
|
child: SvgPicture.asset(
|
|
'assets/img/icon/tick.svg',
|
|
fit: BoxFit.cover,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 42.rpx, 0, 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: 48.rpx,
|
|
letterSpacing: 0.0,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 265.rpx, 0, 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: 30.rpx,
|
|
letterSpacing: 0.0,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 48.rpx, 0, 0),
|
|
child: Container(
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(),
|
|
child: Align(
|
|
alignment: AlignmentDirectional(-1, 0),
|
|
child: Text(
|
|
'绑定成功.分享内容'.tr,
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
fontFamily: 'Inter',
|
|
fontSize: 30.rpx,
|
|
letterSpacing: 0.0,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 110.rpx, 0, 0),
|
|
child: CustomCard(
|
|
borderRadius:
|
|
AppConstants().button_container_radius, // 圆角半径
|
|
onTap: () {
|
|
print('Button pressed ...');
|
|
Get.toNamed("/deviceType");
|
|
},
|
|
colors: [
|
|
// 渐变色
|
|
stringToColor("45D989"), // 左侧渐变色
|
|
stringToColor("00C1AA"), // 右侧渐变色
|
|
],
|
|
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/share.svg',
|
|
width: 25.rpx,
|
|
height: 25.rpx, // 如果 SVG 中没有固定颜色,可以这样设置
|
|
color: Colors.white, // 设置图标颜色为白色
|
|
),
|
|
Text(
|
|
'绑定成功.立即分享'.tr,
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
color: Colors.white, // 文字颜色
|
|
fontFamily: 'Inter',
|
|
fontSize: AppConstants()
|
|
.normal_text_fontSize, // 自定义字体大小
|
|
letterSpacing: 0.0,
|
|
),
|
|
),
|
|
].divide(SizedBox(width: 17.rpx)),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(0, 18.rpx, 0, 0),
|
|
child: CustomCard(
|
|
borderRadius:
|
|
AppConstants().button_container_radius, // 圆角半径
|
|
onTap: () {
|
|
Get.offAllNamed("/mianPageBottomChange");
|
|
},
|
|
colors: [
|
|
// 渐变色
|
|
stringToColor("45D989"), // 左侧渐变色
|
|
stringToColor("00C1AA"), // 右侧渐变色
|
|
],
|
|
|
|
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: [
|
|
Text(
|
|
'绑定成功.返回'.tr,
|
|
style: FlutterFlowTheme.of(context)
|
|
.bodyMedium
|
|
.override(
|
|
color: Colors.white, // 文字颜色
|
|
fontFamily: 'Inter',
|
|
fontSize: AppConstants()
|
|
.normal_text_fontSize, // 自定义字体大小
|
|
letterSpacing: 0.0,
|
|
),
|
|
),
|
|
].divide(SizedBox(width: 17.rpx)),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildDeviceCard(BuildContext context,
|
|
{required String title, required String imageUrl, required String type}) {
|
|
return CustomCard(
|
|
borderRadius: 20.rpx, // 圆角大小
|
|
onTap: () {
|
|
if (type != null) {
|
|
if (type == '1') {
|
|
Get.toNamed("/blueteethDevice");
|
|
}
|
|
}
|
|
},
|
|
// colors: [Colors.white.withOpacity(0.06)], // 背景色
|
|
colors: [stringToColor("#242835")], // 背景色
|
|
child: Container(
|
|
width: double.infinity,
|
|
height: MediaQuery.sizeOf(context).height * 0.135,
|
|
constraints: BoxConstraints(
|
|
minHeight: 220.rpx,
|
|
),
|
|
padding: EdgeInsetsDirectional.fromSTEB(77.rpx, 0, 21.rpx, 0),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Inter',
|
|
color: const Color(0xFFC2CED7),
|
|
fontSize: 30.rpx,
|
|
letterSpacing: 0.0,
|
|
),
|
|
),
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(8.rpx),
|
|
child: Image.asset(
|
|
imageUrl,
|
|
width: 212.rpx,
|
|
height: 168.rpx,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|