更新登录对接
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:loading_indicator/loading_indicator.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
@@ -45,7 +44,8 @@ void showBindDoubleDialog(BuildContext context, List<BleDeviceData> devices) {
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 93.rpx, 0, 0),
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 93.rpx, 0, 0),
|
||||
child: Text(
|
||||
'蓝牙绑定.双人版绑定标题'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
@@ -74,7 +74,7 @@ void showBindDoubleDialog(BuildContext context, List<BleDeviceData> devices) {
|
||||
// 主设备
|
||||
_buildCheckboxRow(
|
||||
context,
|
||||
title: '蓝牙绑定.主设备'.tr,
|
||||
title: '蓝牙绑定.主设备'.tr + "asasasasasas(已被绑定)",
|
||||
value: () => blueteethBindController.model.deviceIndex1!,
|
||||
onChanged: (v) {
|
||||
if (!blueteethBindController.model.deviceIndex1!) {
|
||||
@@ -130,8 +130,6 @@ void showBindDoubleDialog(BuildContext context, List<BleDeviceData> devices) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void showHaveBindDialog(BuildContext context) {
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
@@ -187,7 +185,7 @@ void showHaveBindDialog(BuildContext context) {
|
||||
TextSpan(
|
||||
text: "蓝牙绑定.无法绑定2".tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc10,
|
||||
color: themeController.currentColor.sc8,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
@@ -228,10 +226,9 @@ void showHaveBindDialog(BuildContext context) {
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: Colors.white,
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
@@ -251,6 +248,85 @@ void showHaveBindDialog(BuildContext context) {
|
||||
);
|
||||
}
|
||||
|
||||
void showLoadingDialog(BuildContext context) {
|
||||
ThemeController themeController = Get.find();
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
builder: (BuildContext context) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(60.rpx, 0, 60.rpx, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.sizeOf(context).height * 0.656,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Align(
|
||||
// alignment: AlignmentDirectional(0, 0),
|
||||
// child: Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(
|
||||
// 0.rpx, 93.rpx, 0.rpx, 0.rpx),
|
||||
// child: Text(
|
||||
// '蓝牙绑定.无法绑定'.tr,
|
||||
// style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 30.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController.currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 93.rpx, 0.rpx, 0.rpx),
|
||||
child: SizedBox(
|
||||
width: 120.rpx,
|
||||
height: 120.rpx,
|
||||
child: LoadingIndicator(
|
||||
indicatorType: Indicator.ballSpinFadeLoader,
|
||||
colors: [
|
||||
themeController.currentColor.sc3,
|
||||
],
|
||||
strokeWidth: 1,
|
||||
backgroundColor: Colors.transparent,
|
||||
pathBackgroundColor: themeController.currentColor.sc3),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 27.rpx, 0.rpx, 56.rpx),
|
||||
child: RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text: "连接中...".tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCheckboxRow(
|
||||
BuildContext context, {
|
||||
@@ -260,7 +336,7 @@ Widget _buildCheckboxRow(
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(60.rpx, 64.rpx, 0.rpx, 0.rpx),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(20.rpx, 64.rpx, 0.rpx, 0.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
@@ -270,14 +346,16 @@ Widget _buildCheckboxRow(
|
||||
value: value(),
|
||||
onChanged: onChanged,
|
||||
)),
|
||||
Text(
|
||||
title,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
letterSpacing: 0.0,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 21.rpx)),
|
||||
),
|
||||
@@ -311,7 +389,7 @@ Widget _buildActionButton(
|
||||
Text(
|
||||
text,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
color: Colors.white,
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
@@ -322,3 +400,145 @@ Widget _buildActionButton(
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showConfirmDialog(
|
||||
BuildContext context,
|
||||
Widget widget,
|
||||
String title, {
|
||||
required VoidCallback onConfirm,
|
||||
required VoidCallback onCancel,
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
barrierColor: Colors.black.withOpacity(0.5), // 背景模糊色
|
||||
builder: (BuildContext context) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc17,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
padding: EdgeInsetsDirectional.fromSTEB(64.rpx, 0, 64.rpx, 0),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.sizeOf(context).height * 0.656,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// 标题
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 93.rpx, 0, 0),
|
||||
child: Text(
|
||||
title,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
widget,
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 58.rpx, 0, 60.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onConfirm();
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.115,
|
||||
height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 160.rpx,
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"蓝牙绑定.是".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onCancel();
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.215,
|
||||
height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 160.rpx,
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"蓝牙绑定.否".tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize:
|
||||
AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(
|
||||
width: 70.rpx,
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user