更新消息设置
This commit is contained in:
@@ -1001,132 +1001,400 @@ Future<void> showTipDialog(
|
||||
);
|
||||
}
|
||||
|
||||
// Future<void> showUnBindTipDialog(
|
||||
// BuildContext context,
|
||||
// Widget widget, {
|
||||
// Color? backgroundColor,
|
||||
// VoidCallback? onConfirm, // “继续”按钮回调
|
||||
// VoidCallback? onCancel, // “下次再说”按钮回调
|
||||
// VoidCallback? onNoTip, // “下次再说”按钮回调
|
||||
// }) {
|
||||
// ThemeController themeController = Get.find();
|
||||
// BlueteethBindController blueteethBindController = Get.find();
|
||||
|
||||
// return showDialog(
|
||||
// context: context,
|
||||
// barrierDismissible: true,
|
||||
// barrierColor: Colors.black.withOpacity(0.5),
|
||||
// builder: (BuildContext context) {
|
||||
// return FrostedDialog(
|
||||
// blurSigma: 3.0,
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color: backgroundColor ?? 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, 30.rpx),
|
||||
// child: widget,
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0, 10.rpx),
|
||||
// child: CustomCard(
|
||||
// borderRadius: AppConstants().button_container_radius,
|
||||
// onTap: () {
|
||||
// Get.back(); // 关闭对话框
|
||||
// if (onConfirm != null) {
|
||||
// onConfirm(); // 调用确认回调
|
||||
// }
|
||||
// },
|
||||
// colors: [
|
||||
// themeController.currentColor.sc1,
|
||||
// themeController.currentColor.sc2,
|
||||
// ],
|
||||
// child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// 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: TextStyle(
|
||||
// color: themeController.currentColor.sc3,
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: AppConstants().normal_text_fontSize,
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(width: 17.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsetsDirectional.fromSTEB(0, 19.rpx, 0, 60.rpx),
|
||||
// child: CustomCard(
|
||||
// borderRadius: AppConstants().button_container_radius,
|
||||
// onTap: () {
|
||||
// Get.back(); // 关闭对话框
|
||||
// if (onCancel != null) {
|
||||
// onCancel(); // 调用取消回调
|
||||
// }
|
||||
// },
|
||||
// colors: [Colors.transparent],
|
||||
// child: Container(
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(
|
||||
// color: Colors.white,
|
||||
// width: 0.5.rpx,
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(
|
||||
// AppConstants().button_container_radius),
|
||||
// ),
|
||||
// constraints: BoxConstraints(
|
||||
// minWidth: 500.rpx,
|
||||
// minHeight: 90.rpx,
|
||||
// ),
|
||||
// child: Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Text(
|
||||
// '下次再说'.tr,
|
||||
// style: TextStyle(
|
||||
// color: themeController.currentColor.sc3,
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: AppConstants().normal_text_fontSize,
|
||||
// letterSpacing: 0.0,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(width: 17.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: EdgeInsets.fromLTRB(0, 0, 0, 30.rpx),
|
||||
// child: Container(
|
||||
// width: double.infinity,
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// Container(
|
||||
// width: double.infinity,
|
||||
// child: Row(
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Theme(
|
||||
// data: ThemeData(
|
||||
// checkboxTheme: CheckboxThemeData(
|
||||
// visualDensity: VisualDensity.compact,
|
||||
// materialTapTargetSize:
|
||||
// MaterialTapTargetSize.shrinkWrap,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(64),
|
||||
// ),
|
||||
// ),
|
||||
// unselectedWidgetColor: Color(0xFFD3D3D3),
|
||||
// ),
|
||||
// child: Obx(
|
||||
// () => Checkbox(
|
||||
// value:
|
||||
// blueteethBindController.model.read ==
|
||||
// 1
|
||||
// ? false
|
||||
// : true,
|
||||
// onChanged: (newValue) async {
|
||||
// blueteethBindController.model.read =
|
||||
// newValue == true ? 0 : 1;
|
||||
// blueteethBindController.updateAll();
|
||||
// },
|
||||
// side: BorderSide(
|
||||
// width: 1.5,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// activeColor: stringToColor("#16C89F"),
|
||||
// ),
|
||||
// )),
|
||||
// Text(
|
||||
// '绑定引导.不再提示'.tr,
|
||||
// style: TextStyle(
|
||||
// fontFamily: 'Inter',
|
||||
// fontSize: 26.rpx,
|
||||
// letterSpacing: 0.0,
|
||||
// color: themeController.currentColor.sc3,
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(width: 22.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// ].divide(SizedBox(height: 42.rpx)),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
Future<void> showUnBindTipDialog(
|
||||
BuildContext context,
|
||||
Widget widget, {
|
||||
Color? backgroundColor,
|
||||
VoidCallback? onConfirm, // “继续”按钮回调
|
||||
VoidCallback? onCancel, // “下次再说”按钮回调
|
||||
bool initialNoTipValue = false, // 初始的"不再提示"值,从外部传入
|
||||
ValueChanged<bool>? onNoTipChanged, // "不再提示"值变化时的回调
|
||||
}) {
|
||||
ThemeController themeController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
// 移除原来的控制器依赖,使用传入的初始值
|
||||
// BlueteethBindController blueteethBindController = Get.find();
|
||||
|
||||
// 使用局部状态管理不再提示的值
|
||||
bool noTipValue = initialNoTipValue;
|
||||
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
barrierColor: Colors.black.withOpacity(0.5),
|
||||
builder: (BuildContext context) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor ?? 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, 30.rpx),
|
||||
child: widget,
|
||||
),
|
||||
// 使用StatefulBuilder来管理局部状态
|
||||
return StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
return FrostedDialog(
|
||||
blurSigma: 3.0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor ?? 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,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0, 10.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back(); // 关闭对话框
|
||||
if (onConfirm != null) {
|
||||
onConfirm(); // 调用确认回调
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
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: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Align(
|
||||
alignment: AlignmentDirectional(0, 0),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 93.rpx, 0, 30.rpx),
|
||||
child: widget,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 19.rpx, 0, 60.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back(); // 关闭对话框
|
||||
if (onCancel != null) {
|
||||
onCancel(); // 调用取消回调
|
||||
}
|
||||
},
|
||||
colors: [Colors.transparent],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.white,
|
||||
width: 0.5.rpx,
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 0.rpx, 0, 10.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back(); // 关闭对话框
|
||||
if (onConfirm != null) {
|
||||
onConfirm(); // 调用确认回调
|
||||
}
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
themeController.currentColor.sc2,
|
||||
],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
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: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().button_container_radius),
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 500.rpx,
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'下次再说'.tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 19.rpx, 0, 60.rpx),
|
||||
child: CustomCard(
|
||||
borderRadius: AppConstants().button_container_radius,
|
||||
onTap: () {
|
||||
Get.back(); // 关闭对话框
|
||||
if (onCancel != null) {
|
||||
onCancel(); // 调用取消回调
|
||||
}
|
||||
},
|
||||
colors: [Colors.transparent],
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
height: MediaQuery.sizeOf(context).height * 0.055,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.white,
|
||||
width: 0.5.rpx,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConstants().button_container_radius),
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 500.rpx,
|
||||
minHeight: 90.rpx,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'下次再说'.tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 17.rpx)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 30.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Theme(
|
||||
data: ThemeData(
|
||||
checkboxTheme: CheckboxThemeData(
|
||||
visualDensity: VisualDensity.compact,
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(64),
|
||||
),
|
||||
),
|
||||
unselectedWidgetColor: Color(0xFFD3D3D3),
|
||||
),
|
||||
child: Checkbox(
|
||||
value: noTipValue,
|
||||
onChanged: (newValue) {
|
||||
if (newValue != null) {
|
||||
setState(() {
|
||||
noTipValue = newValue;
|
||||
});
|
||||
|
||||
// 回调新的值给外部
|
||||
if (onNoTipChanged != null) {
|
||||
onNoTipChanged(noTipValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
side: BorderSide(
|
||||
width: 1.5,
|
||||
color: Colors.white,
|
||||
),
|
||||
activeColor: stringToColor("#16C89F"),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'绑定引导.不再提示'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(height: 42.rpx)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user