解绑设备
This commit is contained in:
@@ -1128,3 +1128,235 @@ Future<void> showUnBindTipDialog(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showUnbindConfirmDialog({
|
||||
required BuildContext context,
|
||||
required VoidCallback onConfirm,
|
||||
required VoidCallback onCancel,
|
||||
required String title,
|
||||
}) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
width: 520.rpx,
|
||||
height: 460.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 45.rpx, right: 45.rpx, top: 90.rpx, bottom: 60.rpx),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '该设备只可被一个用户绑定,',
|
||||
style: TextStyle(fontSize: 26.rpx)),
|
||||
TextSpan(
|
||||
text: '解绑后',
|
||||
style: TextStyle(color: Colors.red, fontSize: 26.rpx),
|
||||
),
|
||||
TextSpan(
|
||||
text: '其他用户才可以绑定',
|
||||
style: TextStyle(fontSize: 26.rpx)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CustomCard(
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
borderRadius: 16.rpx,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onCancel();
|
||||
},
|
||||
colors: [
|
||||
Color(0xFF1592AA),
|
||||
Color(0XFF0C83A7),
|
||||
Color(0XFF006FA3)
|
||||
],
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
),
|
||||
)),
|
||||
CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onConfirm();
|
||||
},
|
||||
colors: [
|
||||
Color(0xFF1592AA),
|
||||
Color(0XFF0C83A7),
|
||||
Color(0XFF006FA3)
|
||||
],
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'解绑',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
),
|
||||
))
|
||||
// _buildButton(
|
||||
// text: '解绑',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// onConfirm();
|
||||
// },
|
||||
// isGradient: true,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showDeleteDeviceConfirmDialog({
|
||||
required BuildContext context,
|
||||
required VoidCallback onConfirm,
|
||||
required VoidCallback onCancel,
|
||||
required String title,
|
||||
}) async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
width: 520.rpx,
|
||||
height: 460.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 45.rpx, right: 45.rpx, top: 90.rpx, bottom: 60.rpx),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(
|
||||
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '删除后,',
|
||||
style:
|
||||
TextStyle(color: Colors.red, fontSize: 26.rpx)),
|
||||
TextSpan(
|
||||
text: '该设备的历史数据将被清除',
|
||||
style: TextStyle(fontSize: 26.rpx),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
CustomCard(
|
||||
gradientDirection: GradientDirection.vertical,
|
||||
borderRadius: 16.rpx,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onCancel();
|
||||
},
|
||||
colors: [
|
||||
Color(0xFF1592AA),
|
||||
Color(0XFF0C83A7),
|
||||
Color(0XFF006FA3)
|
||||
],
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
),
|
||||
)),
|
||||
CustomCard(
|
||||
borderRadius: 16.rpx,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onConfirm();
|
||||
},
|
||||
colors: [
|
||||
Color(0xFF1592AA),
|
||||
Color(0XFF0C83A7),
|
||||
Color(0XFF006FA3)
|
||||
],
|
||||
child: Container(
|
||||
width: 200.rpx,
|
||||
height: 90.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'删除',
|
||||
style: TextStyle(
|
||||
fontSize: 26.rpx, color: Colors.white),
|
||||
),
|
||||
))
|
||||
// _buildButton(
|
||||
// text: '解绑',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// onConfirm();
|
||||
// },
|
||||
// isGradient: true,
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user