分享设备用户列表
This commit is contained in:
@@ -1,43 +1,60 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appColors.dart';
|
||||
import 'package:fluwx/fluwx.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.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/common/util/requestWithLog.dart';
|
||||
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/device_list_controller.dart';
|
||||
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
|
||||
|
||||
import '../../common/color/appFontsize.dart';
|
||||
|
||||
class ShareDeviceDetailWidget extends GetView {
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
Map data;
|
||||
ShareDeviceDetailWidget({super.key, required this.data});
|
||||
getLine() {
|
||||
return Divider(
|
||||
color: const Color(0XFF929699),
|
||||
thickness: 0.5.rpx,
|
||||
);
|
||||
}
|
||||
|
||||
var opType = 1.obs;
|
||||
bool isProgrammaticPop = false; // 标记变量
|
||||
DateTime? _lastBackPressedTime; // 记录上一次返回的时间
|
||||
DeviceListController deviceListController = Get.find();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MHDeviceShareController deviceShareController = Get.find();
|
||||
var shareInfo = deviceShareController.model.mainShare;
|
||||
RxInt type = 1.obs;
|
||||
type.value = shareInfo['op_type'];
|
||||
|
||||
opType.value = data['info'][3]['opType'];
|
||||
return GestureDetector(
|
||||
// onTap: () => FocusScope.of(context).unfocus(),,
|
||||
// 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(
|
||||
key: scaffoldKey,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
automaticallyImplyLeading: false,
|
||||
iconTheme: IconThemeData(color: Colors.white),
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
titleSpacing: 0,
|
||||
// leading: returnIconButtomAddCallback(() {
|
||||
// controller.saveDataApi();
|
||||
// updateParm(isShowToast: false);
|
||||
// }),
|
||||
// leading: returnIconButtomNew,
|
||||
title: Container(
|
||||
title: SizedBox(
|
||||
width: double.infinity,
|
||||
height: 180.rpx,
|
||||
child: Stack(
|
||||
@@ -55,265 +72,404 @@ class ShareDeviceDetailWidget extends GetView {
|
||||
// 左侧图标
|
||||
Positioned(
|
||||
left: 0.rpx,
|
||||
child: returnIconButtomNew,
|
||||
child: returnIconButtomNew(onBack: () async {
|
||||
try {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.device_show;
|
||||
String queryUrl =
|
||||
"$serviceAddress$serviceName$serviceApi";
|
||||
await requestWithLog(
|
||||
logTitle: "更新设备信息",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: {
|
||||
"id": data['info'][4]["id"],
|
||||
"opType": opType.value
|
||||
},
|
||||
onSuccess: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新成功".tr, textColor: Color(0XFF00C1AA));
|
||||
deviceListController.getDeviceList();
|
||||
try {
|
||||
WebviewTestController webviewTestController =
|
||||
Get.find();
|
||||
webviewTestController.web.jsbridge?.dart
|
||||
.alterDevice();
|
||||
} catch (e) {
|
||||
ef.log("[h5]通知列表更新错误:$e");
|
||||
}
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新失败".tr, textColor: Color(0xFFFF7159));
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
actions: [],
|
||||
centerTitle: false,
|
||||
),
|
||||
body: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 1,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFF6F6F6),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(15, 0, 15, 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 13, 0, 0),
|
||||
child: Container(
|
||||
body: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (disposition, result) async {
|
||||
if (isProgrammaticPop) {
|
||||
// 如果是程序触发,重置标记并忽略
|
||||
isProgrammaticPop = false;
|
||||
return; // 阻止处理
|
||||
}
|
||||
try {
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.device_show;
|
||||
String queryUrl = "$serviceAddress$serviceName$serviceApi";
|
||||
await requestWithLog(
|
||||
logTitle: "更新设备信息",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: {"id": data['info'][4]["id"], "opType": opType.value},
|
||||
onSuccess: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新成功".tr, textColor: Color(0XFF00C1AA));
|
||||
deviceListController.getDeviceList();
|
||||
try {
|
||||
WebviewTestController webviewTestController = Get.find();
|
||||
webviewTestController.web.jsbridge?.dart.alterDevice();
|
||||
} catch (e) {
|
||||
ef.log("[h5]通知列表更新错误:$e");
|
||||
}
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "更新失败".tr, textColor: Color(0xFFFF7159));
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
if (Platform.isAndroid) {
|
||||
var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
if (flag) {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 1,
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 34.rpx, 30.rpx, 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(16, 13, 16, 15),
|
||||
child: Column(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${shareInfo['userName']}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF333333),
|
||||
fontSize: 15,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'分享时间:${MyUtils.timestampToDateString(int.parse(shareInfo['startTime'].toString()))}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
fontSize: 11,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 5)),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: 27.rpx, bottom: 18.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
data['info'][0]['v'],
|
||||
// '${shareInfo['userName']}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: const Color(0xFFFFFFFF),
|
||||
fontSize: 28.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'分享时间:${data['info'][2]['v']}',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: const Color(0xFF9EA4B7),
|
||||
fontSize: 20.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 10.rpx)),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => GestureDetector(
|
||||
onTap: () {
|
||||
// 当点击时,将 type 设置为 0(允许控制)
|
||||
type.value = 1;
|
||||
controller.updateAll();
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
getLine(),
|
||||
SizedBox(
|
||||
height: 25.rpx,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF003058),
|
||||
borderRadius: BorderRadius.circular(16.rpx)),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: 38.rpx,
|
||||
top: 50.rpx,
|
||||
end: 30.rpx,
|
||||
bottom: 30.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'允许对方控制和查看该设备'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF333333),
|
||||
fontSize: 13,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// 当点击时,将 type 设置为 0(允许控制)
|
||||
|
||||
data['info'][3]['opType'] = 1;
|
||||
opType.value = 1;
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'允许对方控制和查看该设备'.tr,
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
const Color(0xFFFFFFFF),
|
||||
fontSize: 27.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return Container(
|
||||
height: 33.rpx,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 33.rpx,
|
||||
width: 33.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
33.rpx / 2),
|
||||
border: Border.all(
|
||||
width:
|
||||
opType.value == 1
|
||||
? 1
|
||||
: 0.5,
|
||||
color:
|
||||
Color(0xFFC8CBD2),
|
||||
),
|
||||
),
|
||||
child: opType.value == 1
|
||||
? Center(
|
||||
child: ClipOval(
|
||||
child:
|
||||
Container(
|
||||
width:
|
||||
33.rpx *
|
||||
0.6,
|
||||
height:
|
||||
33.rpx *
|
||||
0.6,
|
||||
color: const Color(
|
||||
0xFF6BFDAC),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, -1),
|
||||
child: Icon(
|
||||
type.value == 1
|
||||
? Icons.check_circle // 选中时为实心圆
|
||||
: Icons
|
||||
.radio_button_unchecked, // 未选中时为空心圆
|
||||
color: type.value == 1
|
||||
? Color(0xFFD3B684) // 选中时的颜色
|
||||
: Colors.grey, // 未选中时的颜色
|
||||
size: 18,
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// 当点击时,将 type 设置为 1(仅允许查看)
|
||||
data['info'][3]['opType'] = 2;
|
||||
opType.value = 2;
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'仅允许对方查看该设备'.tr,
|
||||
style: FlutterFlowTheme.of(
|
||||
context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color:
|
||||
const Color(0xFFFFFFFF),
|
||||
fontSize: 27.rpx,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return Container(
|
||||
height: 33.rpx,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 33.rpx,
|
||||
width: 33.rpx,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
33.rpx / 2),
|
||||
border: Border.all(
|
||||
width:
|
||||
opType.value == 2
|
||||
? 1
|
||||
: 0.5,
|
||||
color:
|
||||
Color(0xFFC8CBD2),
|
||||
),
|
||||
),
|
||||
child: opType.value == 2
|
||||
? Center(
|
||||
child: ClipOval(
|
||||
child:
|
||||
Container(
|
||||
width:
|
||||
33.rpx *
|
||||
0.6,
|
||||
height:
|
||||
33.rpx *
|
||||
0.6,
|
||||
color: const Color(
|
||||
0xFF6BFDAC),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => GestureDetector(
|
||||
onTap: () {
|
||||
// 当点击时,将 type 设置为 1(仅允许查看)
|
||||
type.value = 2;
|
||||
controller.updateAll();
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'仅允许对方查看该设备'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF333333),
|
||||
fontSize: 13,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, -1),
|
||||
child: Icon(
|
||||
type.value == 2
|
||||
? Icons.check_circle // 选中时为实心圆
|
||||
: Icons
|
||||
.radio_button_unchecked, // 未选中时为空心圆
|
||||
color: type.value == 2
|
||||
? Color(0xFFD3B684) // 选中时的颜色
|
||||
: Colors.grey, // 未选中时的颜色
|
||||
size: 18,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 13)),
|
||||
),
|
||||
),
|
||||
))
|
||||
]),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
15, 0, 15, AppConstants.page_button_bottom_padding),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.056,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||
0, 0, 0, AppConstants.page_button_bottom_padding),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.056,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
FlutterFlowTheme.of(context).secondaryBackground,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
onTap: () async {},
|
||||
colors: const [
|
||||
Color(0xFFFCFCFC),
|
||||
Color(0xFFF8FAF9),
|
||||
Color(0XFFECF6F3),
|
||||
Color(0XFFD9F0E9),
|
||||
Color(0xFFCEECE3)
|
||||
],
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text("解除分享".tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF003058),
|
||||
fontSize: 30.rpx,
|
||||
)),
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.056,
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 46,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context).secondaryBackground,
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.056,
|
||||
decoration: BoxDecoration(
|
||||
color: FlutterFlowTheme.of(context)
|
||||
.secondaryBackground,
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
)
|
||||
|
||||
// FFButtonWidget(
|
||||
// onPressed: () {
|
||||
// showCustomConfirmDialog(context, "是否确定删除?").then((v) {
|
||||
// if ('confirm' == v) {
|
||||
// // deviceShareController
|
||||
// // .deleteShare(shareInfo)
|
||||
// // .then((d) {
|
||||
// // deviceShareController.initData();
|
||||
// // deviceShareController.updateAll();
|
||||
// // Get.back();
|
||||
// // });
|
||||
// // print("showCustomConfirmDialog $v");
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// text: '删除',
|
||||
// options: FFButtonOptions(
|
||||
// height: 40,
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(24, 0, 24, 0),
|
||||
// iconPadding:
|
||||
// EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
|
||||
// color: Color(0xFFE55E92),
|
||||
// textStyle:
|
||||
// FlutterFlowTheme.of(context).titleSmall.override(
|
||||
// fontFamily: 'Readex Pro',
|
||||
// color: Colors.white,
|
||||
// fontSize: 13,
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// elevation: 3,
|
||||
// borderSide: BorderSide(
|
||||
// color: Colors.transparent,
|
||||
// width: 1,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(8),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
),
|
||||
child: CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
onTap: () async {
|
||||
deviceListController.unbindShareDevice(
|
||||
data['info'][5]['uid'], data['mac'], context);
|
||||
},
|
||||
colors: const [
|
||||
Color(0xFFFCFCFC),
|
||||
Color(0xFFF8FAF9),
|
||||
Color(0XFFECF6F3),
|
||||
Color(0XFFD9F0E9),
|
||||
Color(0xFFCEECE3)
|
||||
],
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
child: Text("解除分享".tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF003058),
|
||||
fontSize: 30.rpx,
|
||||
)),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
Future<bool> _handleBackPressed(BuildContext context) async {
|
||||
final currentTime = DateTime.now();
|
||||
// 如果上次点击返回键时间为空,或者间隔超过 1 秒
|
||||
if (_lastBackPressedTime == null ||
|
||||
currentTime.difference(_lastBackPressedTime!) > Duration(seconds: 2)) {
|
||||
_lastBackPressedTime = currentTime;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: "再按一次退出程序".tr,
|
||||
);
|
||||
return false; // 阻止退出程序
|
||||
} else {
|
||||
return true; // 允许退出程序
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user