|
|
@@ -7,17 +7,33 @@ import '../../config/theme/dark_theme_colors.dart';
|
|
|
import '../../utils/system_helper.dart';
|
|
|
import '../constants/iconfont/iconfont.dart';
|
|
|
import '../data/models/launch/upgrade.dart';
|
|
|
+import '../routes/app_pages.dart';
|
|
|
import 'custom_dialog.dart';
|
|
|
|
|
|
/// 弹窗使用示例
|
|
|
class AllDialog {
|
|
|
/// 显示绑定邮箱/会员权益弹窗
|
|
|
static void showBindEmailMemberBenefits() {
|
|
|
- CustomDialog.showInfo(
|
|
|
+ final isLight = ReactiveTheme.isLightTheme;
|
|
|
+ CustomDialog.showError(
|
|
|
title: Strings.bindEmailMemberBenefits.tr,
|
|
|
message: Strings.bindingAccountEmailProtectsPreRights.tr,
|
|
|
icon: IconFont.icon23,
|
|
|
- iconColor: DarkThemeColors.subscriptionColor,
|
|
|
+ iconColor: isLight
|
|
|
+ ? Get.reactiveTheme.primaryColor
|
|
|
+ : DarkThemeColors.subscriptionColor,
|
|
|
+ titleColor: isLight ? Get.reactiveTheme.primaryColor : null,
|
|
|
+ buttonText: Strings.login.tr,
|
|
|
+ cancelText: Strings.cancel.tr,
|
|
|
+ onPressed: () {
|
|
|
+ // 处理重试逻辑
|
|
|
+ Navigator.of(Get.context!).pop();
|
|
|
+ Get.toNamed(Routes.LOGIN);
|
|
|
+ },
|
|
|
+ onCancel: () {
|
|
|
+ // 处理取消逻辑
|
|
|
+ Navigator.of(Get.context!).pop();
|
|
|
+ },
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -81,8 +97,9 @@ class AllDialog {
|
|
|
buttonText: Strings.logOut.tr,
|
|
|
cancelText: Strings.cancel.tr,
|
|
|
icon: Icons.info_outline,
|
|
|
- iconColor: const Color(0xFFFF3B30),
|
|
|
- confirmButtonColor: const Color(0xFFFF3B30),
|
|
|
+ iconColor: DarkThemeColors.errorColor,
|
|
|
+ titleColor: DarkThemeColors.errorColor,
|
|
|
+ confirmButtonColor: DarkThemeColors.errorColor,
|
|
|
onPressed: () {
|
|
|
// 处理退出登录逻辑
|
|
|
Navigator.of(Get.context!).pop();
|
|
|
@@ -112,11 +129,16 @@ class AllDialog {
|
|
|
|
|
|
/// 显示UID信息弹窗
|
|
|
static void showUidInfo() {
|
|
|
+ final isLight = ReactiveTheme.isLightTheme;
|
|
|
CustomDialog.showInfo(
|
|
|
icon: IconFont.icon14,
|
|
|
- iconColor: Get.theme.textTheme.bodyLarge!.color,
|
|
|
+ iconColor: isLight
|
|
|
+ ? Get.reactiveTheme.primaryColor
|
|
|
+ : Get.theme.textTheme.bodyLarge!.color,
|
|
|
+ titleColor: isLight ? Get.reactiveTheme.primaryColor : null,
|
|
|
title: Strings.whatIsUid.tr,
|
|
|
message: Strings.uidMessage.tr,
|
|
|
+ messageColor: Get.theme.textTheme.bodyLarge!.color,
|
|
|
buttonText: Strings.ok.tr,
|
|
|
onPressed: () {
|
|
|
// 处理邮件发送成功后的逻辑
|
|
|
@@ -151,7 +173,9 @@ class AllDialog {
|
|
|
buttonText: Strings.deleteAccount.tr,
|
|
|
cancelText: Strings.cancel.tr,
|
|
|
icon: IconFont.icon40,
|
|
|
- iconColor: DarkThemeColors.deleteAccountIconColor,
|
|
|
+ iconColor: DarkThemeColors.errorColor,
|
|
|
+ titleColor: DarkThemeColors.errorColor,
|
|
|
+ confirmButtonColor: DarkThemeColors.errorColor,
|
|
|
onPressed: () {
|
|
|
// 处理删除账户逻辑
|
|
|
Navigator.of(Get.context!).pop();
|
|
|
@@ -166,8 +190,11 @@ class AllDialog {
|
|
|
|
|
|
/// 显示更新弹窗
|
|
|
static void showUpdate(Upgrade upgrade, {bool hasForceUpdate = false}) {
|
|
|
+ final isLight = ReactiveTheme.isLightTheme;
|
|
|
CustomDialog.showUpdateDialog(
|
|
|
title: Strings.newVersionAvailable.tr,
|
|
|
+ iconColor: isLight ? Get.reactiveTheme.primaryColor : null,
|
|
|
+ titleColor: isLight ? Get.reactiveTheme.primaryColor : null,
|
|
|
message: upgrade.info ?? '',
|
|
|
buttonText: Strings.upgradeNow.tr,
|
|
|
cancelText: hasForceUpdate ? null : Strings.cancel.tr,
|