소스 검색

重新定义全局默认弹窗的样式AddDefaultDialog。
退出登录与删除账号的弹窗与逻辑

liukai 2 주 전
부모
커밋
53810f0670

+ 133 - 0
packages/cpt_profile/lib/modules/setting/dialog/account_deactivation_dialog.dart

@@ -0,0 +1,133 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/widget_export.dart';
+
+class AccountDeactivationDialog extends StatelessWidget {
+  VoidCallback confirmAction;
+
+  AccountDeactivationDialog({
+    required this.confirmAction,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.center,
+      mainAxisAlignment: MainAxisAlignment.center,
+      children: [
+        Container(
+          width: double.infinity,
+          height: 55,
+          decoration: BoxDecoration(
+            color: context.appColors.btnBgDefault,
+            borderRadius: const BorderRadius.only(
+              topRight: Radius.circular(15),
+              topLeft: Radius.circular(15),
+            ),
+          ),
+          child: Row(
+            children: [
+              const SizedBox(width: 45),
+              MyTextView(
+                S.current.account_deactivation,
+                fontSize: 18,
+                textAlign: TextAlign.center,
+                isFontMedium: true,
+                textColor: Colors.white,
+              ).expanded(),
+              const MyAssetImage(
+                Assets.baseServiceDialogDeleteIcon,
+                width: 25,
+                height: 25.5,
+              ).onTap(() {
+                onCancel();
+              }, padding: 10)
+            ],
+          ),
+        ),
+        Container(
+          width: double.infinity,
+          padding: const EdgeInsets.only(top: 22),
+          decoration: BoxDecoration(
+            color: context.appColors.whiteSecondBG,
+            borderRadius: const BorderRadius.only(
+              bottomLeft: Radius.circular(15),
+              bottomRight: Radius.circular(15),
+            ),
+          ),
+          child: Column(
+            children: [
+              const MyAssetImage(Assets.mainAccountDeactivationImg, width: 296.5, height: 158.5),
+
+              MyTextView(
+                S.current.account_deactivate_alert,
+                textAlign: TextAlign.center,
+                textColor: context.appColors.textBlack,
+                marginTop: 24,
+                paddingLeft: 30,
+                paddingRight: 30,
+                fontSize: 15,
+                isFontMedium: true,
+              ),
+
+              Row(
+                children: [
+                  const SizedBox(width: 18),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () {
+                          onCancel();
+                        },
+                        child: MyTextView(
+                          S.current.no,
+                          fontSize: 16,
+                          isFontMedium: true,
+                          paddingTop: 13,
+                          marginRight: 15,
+                          paddingBottom: 13,
+                          textAlign: TextAlign.center,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.orangeBG,
+                          cornerRadius: 7,
+                        ),
+                      )),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () async {
+                          onCancel();
+                          confirmAction();
+                        },
+                        child: MyTextView(
+                          S.current.yes,
+                          fontSize: 16,
+                          paddingTop: 13,
+                          paddingBottom: 13,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.btnBgDefault,
+                          cornerRadius: 7,
+                        ),
+                      )),
+                  const SizedBox(width: 18),
+                ],
+              ).marginOnly(bottom: 30, top: 28),
+            ],
+          ),
+        ),
+      ],
+    ).constrained(width: 340);
+  }
+
+//取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+}

+ 15 - 1
packages/cpt_profile/lib/modules/setting/setting_page.dart

@@ -10,6 +10,7 @@ import 'package:plugin_basic/provider/app_config/app_config_service.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_button.dart';
 import 'package:widgets/my_text_view.dart';
 import 'package:widgets/shatter/setting_item_container.dart';
 
@@ -68,7 +69,7 @@ class SettingPage extends HookConsumerWidget {
             SettingItemContainer(title: S.current.terms_conditions),
 
             //删除账号
-            SettingItemContainer(title: S.current.account_deactivation),
+            SettingItemContainer(title: S.current.account_deactivation).onTap(viewModel.doDeleteAccount),
 
             //评价我们
             SettingItemContainer(title: S.current.rate_us),
@@ -83,6 +84,19 @@ class SettingPage extends HookConsumerWidget {
                 isFontMedium: true,
               ),
             ),
+
+            //提交按钮
+            MyButton(
+              onPressed: viewModel.doLogout,
+              text: S.current.logout,
+              textColor: Colors.white,
+              backgroundColor: context.appColors.btnBgDefault,
+              fontWeight: FontWeight.w500,
+              type: ClickType.throttle,
+              fontSize: 16,
+              minHeight: 50,
+              radius: 5,
+            ).marginOnly(top: 22, bottom: 25, left: 15, right: 15),
           ],
         ),
       ),

+ 26 - 0
packages/cpt_profile/lib/modules/setting/setting_view_model.dart

@@ -1,7 +1,12 @@
 import 'package:cpt_profile/modules/change_mobile/change_mobile_page.dart';
 import 'package:cpt_profile/modules/reset_password/reset_password_page.dart';
+import 'package:cpt_profile/modules/setting/dialog/account_deactivation_dialog.dart';
 import 'package:cpt_profile/modules/setting/setting_state.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:widgets/dialog/app_default_dialog.dart';
 
 part 'setting_view_model.g.dart';
 
@@ -24,4 +29,25 @@ class SettingViewModel extends _$SettingViewModel {
   void gotoResetPasswordPage() {
     ResetPasswordPage.startInstance();
   }
+
+  // 退出登录
+  void doLogout() {
+    DialogEngine.show(
+        widget: AppDefaultDialog(
+      message: "Are you sure you want to logout?",
+      confirmAction: () {
+        ToastEngine.show("点击了确定");
+      },
+    ));
+  }
+
+  //展示删除账号的提示弹窗
+  void doDeleteAccount() {
+    DialogEngine.show(widget: AccountDeactivationDialog(
+      confirmAction: () {
+        ToastEngine.show("点击了确定");
+      },
+    ));
+  }
+
 }

BIN
packages/cs_resources/assets/base_service/dialog_delete_icon.webp


BIN
packages/cs_resources/assets/main/account_deactivation_img.webp


+ 1 - 0
packages/cs_resources/lib/generated/assets.dart

@@ -39,6 +39,7 @@ class Assets {
   static const String baseServiceTitleBarFilterIcon = 'assets/base_service/title_bar_filter_icon.webp';
   static const String baseServiceTriangleDropDown = 'assets/base_service/triangle_drop_down.webp';
   static const String baseServiceTriangleDropDownIcon = 'assets/base_service/triangle_drop_down_icon.webp';
+  static const String mainAccountDeactivationImg = 'assets/main/account_deactivation_img.webp';
   static const String propertyAdvicePic2x = 'assets/property/advice_pic@2x.png';
   static const String propertyApproval2x = 'assets/property/approval@2x.png';
   static const String propertyConveyancingLawyer2x = 'assets/property/conveyancing_lawyer@2x.png';

+ 10 - 1
packages/cs_resources/lib/generated/intl/messages_en.dart

@@ -28,10 +28,12 @@ class MessageLookup extends MessageLookupByLibrary {
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
-        "Logout": MessageLookupByLibrary.simpleMessage("Logout"),
+        "account_deactivate_alert": MessageLookupByLibrary.simpleMessage(
+            "Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request."),
         "account_deactivation":
             MessageLookupByLibrary.simpleMessage("Account Deactivation"),
         "agree_to": MessageLookupByLibrary.simpleMessage("Agree to"),
+        "alert": MessageLookupByLibrary.simpleMessage("Alert"),
         "block": MessageLookupByLibrary.simpleMessage("Block"),
         "block_desc": MessageLookupByLibrary.simpleMessage(
             "Block refers to the street number of the unit\'s official mailing address"),
@@ -39,8 +41,10 @@ class MessageLookup extends MessageLookupByLibrary {
             "123 Example Road #08-08 Country 123456"),
         "block_example_desc": MessageLookupByLibrary.simpleMessage(
             "123 is the block number #08-08 is the unit number"),
+        "cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
         "change_mobile_phone":
             MessageLookupByLibrary.simpleMessage("Change Mobile Phone"),
+        "confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
         "confirm_new_password":
             MessageLookupByLibrary.simpleMessage("Confirm New Password"),
         "confirm_password":
@@ -72,12 +76,16 @@ class MessageLookup extends MessageLookupByLibrary {
         "household": MessageLookupByLibrary.simpleMessage("Household"),
         "last_name": MessageLookupByLibrary.simpleMessage("Last Name"),
         "login": MessageLookupByLibrary.simpleMessage("Log In"),
+        "logout": MessageLookupByLibrary.simpleMessage("Logout"),
+        "logout_alert": MessageLookupByLibrary.simpleMessage(
+            "Are you sure you want to logout?"),
         "mobile_phone": MessageLookupByLibrary.simpleMessage("Mobile Phone"),
         "my_post": MessageLookupByLibrary.simpleMessage("My Posts"),
         "new_mobile_phone":
             MessageLookupByLibrary.simpleMessage("New Mobile Phone"),
         "new_password": MessageLookupByLibrary.simpleMessage("New Password"),
         "next": MessageLookupByLibrary.simpleMessage("Next"),
+        "no": MessageLookupByLibrary.simpleMessage("No"),
         "notice_board": MessageLookupByLibrary.simpleMessage("Notice Board"),
         "notification": MessageLookupByLibrary.simpleMessage("Notification"),
         "old_mobile_phone":
@@ -151,6 +159,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Who are owners?"),
         "who_are_tenants":
             MessageLookupByLibrary.simpleMessage("Who are tenants?"),
+        "yes": MessageLookupByLibrary.simpleMessage("Yes"),
         "you_have": MessageLookupByLibrary.simpleMessage("You have"),
         "yy_home_accounts":
             MessageLookupByLibrary.simpleMessage("YY Home Accounts")

+ 9 - 1
packages/cs_resources/lib/generated/intl/messages_zh_CN.dart

@@ -28,16 +28,20 @@ class MessageLookup extends MessageLookupByLibrary {
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
-        "Logout": MessageLookupByLibrary.simpleMessage("退出登录"),
+        "account_deactivate_alert": MessageLookupByLibrary.simpleMessage(
+            "您确定要停用您的帐户吗?一旦您继续执行请求,您将无法登录应用程序。"),
         "account_deactivation": MessageLookupByLibrary.simpleMessage("删除账号"),
         "agree_to": MessageLookupByLibrary.simpleMessage("同意"),
+        "alert": MessageLookupByLibrary.simpleMessage("提示"),
         "block": MessageLookupByLibrary.simpleMessage("街区"),
         "block_desc": MessageLookupByLibrary.simpleMessage("街区是指单位官方邮编街道号"),
         "block_example":
             MessageLookupByLibrary.simpleMessage("123 示例路 #08-08 国家 123456"),
         "block_example_desc":
             MessageLookupByLibrary.simpleMessage("123 是街区地址邮编 #08-08 是单元号码"),
+        "cancel": MessageLookupByLibrary.simpleMessage("取消"),
         "change_mobile_phone": MessageLookupByLibrary.simpleMessage("修改手机号码"),
+        "confirm": MessageLookupByLibrary.simpleMessage("确认"),
         "confirm_new_password": MessageLookupByLibrary.simpleMessage("确认新密码"),
         "confirm_password": MessageLookupByLibrary.simpleMessage("确认密码"),
         "create_new_yy_home_account":
@@ -62,11 +66,14 @@ class MessageLookup extends MessageLookupByLibrary {
         "household": MessageLookupByLibrary.simpleMessage("家庭"),
         "last_name": MessageLookupByLibrary.simpleMessage("姓"),
         "login": MessageLookupByLibrary.simpleMessage("登录"),
+        "logout": MessageLookupByLibrary.simpleMessage("退出登录"),
+        "logout_alert": MessageLookupByLibrary.simpleMessage("你确定要退出登录吗?"),
         "mobile_phone": MessageLookupByLibrary.simpleMessage("手机号码"),
         "my_post": MessageLookupByLibrary.simpleMessage("我的发布"),
         "new_mobile_phone": MessageLookupByLibrary.simpleMessage("新的手机号码"),
         "new_password": MessageLookupByLibrary.simpleMessage("新密码"),
         "next": MessageLookupByLibrary.simpleMessage("下一步"),
+        "no": MessageLookupByLibrary.simpleMessage("否"),
         "notice_board": MessageLookupByLibrary.simpleMessage("消息板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "old_mobile_phone": MessageLookupByLibrary.simpleMessage("旧的手机号码"),
@@ -121,6 +128,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "welcome_name": m2,
         "who_are_owners": MessageLookupByLibrary.simpleMessage("怎样才算业主?"),
         "who_are_tenants": MessageLookupByLibrary.simpleMessage("怎样才算租户?"),
+        "yes": MessageLookupByLibrary.simpleMessage("是"),
         "you_have": MessageLookupByLibrary.simpleMessage("你还有"),
         "yy_home_accounts": MessageLookupByLibrary.simpleMessage("YY Home 账户")
       };

+ 9 - 1
packages/cs_resources/lib/generated/intl/messages_zh_HK.dart

@@ -28,16 +28,20 @@ class MessageLookup extends MessageLookupByLibrary {
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
-        "Logout": MessageLookupByLibrary.simpleMessage("退出登录"),
+        "account_deactivate_alert": MessageLookupByLibrary.simpleMessage(
+            "您确定要停用您的帐户吗?一旦您继续执行请求,您将无法登录应用程序。"),
         "account_deactivation": MessageLookupByLibrary.simpleMessage("删除账号"),
         "agree_to": MessageLookupByLibrary.simpleMessage("同意"),
+        "alert": MessageLookupByLibrary.simpleMessage("提示"),
         "block": MessageLookupByLibrary.simpleMessage("街区"),
         "block_desc": MessageLookupByLibrary.simpleMessage("街区是指单位官方邮编街道号"),
         "block_example":
             MessageLookupByLibrary.simpleMessage("123 示例路 #08-08 国家 123456"),
         "block_example_desc":
             MessageLookupByLibrary.simpleMessage("123 是街区地址邮编 #08-08 是单元号码"),
+        "cancel": MessageLookupByLibrary.simpleMessage("取消"),
         "change_mobile_phone": MessageLookupByLibrary.simpleMessage("修改手机号码"),
+        "confirm": MessageLookupByLibrary.simpleMessage("确认"),
         "confirm_new_password": MessageLookupByLibrary.simpleMessage("确认新密码"),
         "confirm_password": MessageLookupByLibrary.simpleMessage("确认密码"),
         "create_new_yy_home_account":
@@ -62,11 +66,14 @@ class MessageLookup extends MessageLookupByLibrary {
         "household": MessageLookupByLibrary.simpleMessage("家庭"),
         "last_name": MessageLookupByLibrary.simpleMessage("姓"),
         "login": MessageLookupByLibrary.simpleMessage("登录"),
+        "logout": MessageLookupByLibrary.simpleMessage("退出登录"),
+        "logout_alert": MessageLookupByLibrary.simpleMessage("你确定要退出登录吗?"),
         "mobile_phone": MessageLookupByLibrary.simpleMessage("手机号码"),
         "my_post": MessageLookupByLibrary.simpleMessage("我的发布"),
         "new_mobile_phone": MessageLookupByLibrary.simpleMessage("新的手机号码"),
         "new_password": MessageLookupByLibrary.simpleMessage("新密码"),
         "next": MessageLookupByLibrary.simpleMessage("下一步"),
+        "no": MessageLookupByLibrary.simpleMessage("否"),
         "notice_board": MessageLookupByLibrary.simpleMessage("通知板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "old_mobile_phone": MessageLookupByLibrary.simpleMessage("旧的手机号码"),
@@ -106,6 +113,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "verification_code": MessageLookupByLibrary.simpleMessage("验证码"),
         "version_no": MessageLookupByLibrary.simpleMessage("版本号."),
         "welcome_name": m2,
+        "yes": MessageLookupByLibrary.simpleMessage("是"),
         "you_have": MessageLookupByLibrary.simpleMessage("你还有"),
         "yy_home_accounts": MessageLookupByLibrary.simpleMessage("YY Home 账户")
       };

+ 72 - 2
packages/cs_resources/lib/generated/l10n.dart

@@ -801,10 +801,10 @@ class S {
   }
 
   /// `Logout`
-  String get Logout {
+  String get logout {
     return Intl.message(
       'Logout',
-      name: 'Logout',
+      name: 'logout',
       desc: '',
       args: [],
     );
@@ -860,6 +860,76 @@ class S {
     );
   }
 
+  /// `Cancel`
+  String get cancel {
+    return Intl.message(
+      'Cancel',
+      name: 'cancel',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Confirm`
+  String get confirm {
+    return Intl.message(
+      'Confirm',
+      name: 'confirm',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Yes`
+  String get yes {
+    return Intl.message(
+      'Yes',
+      name: 'yes',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `No`
+  String get no {
+    return Intl.message(
+      'No',
+      name: 'no',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Alert`
+  String get alert {
+    return Intl.message(
+      'Alert',
+      name: 'alert',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Are you sure you want to logout?`
+  String get logout_alert {
+    return Intl.message(
+      'Are you sure you want to logout?',
+      name: 'logout_alert',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.`
+  String get account_deactivate_alert {
+    return Intl.message(
+      'Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.',
+      name: 'account_deactivate_alert',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

+ 8 - 1
packages/cs_resources/lib/l10n/intl_en.arb

@@ -74,11 +74,18 @@
   "account_deactivation": "Account Deactivation",
   "rate_us": "Rate Us",
   "version_no": "Version No.",
-  "Logout": "Logout",
+  "logout": "Logout",
   "old_mobile_phone": "Old Mobile Phone",
   "new_mobile_phone": "New Mobile Phone",
   "submit": "Submit",
   "new_password": "New Password",
   "confirm_new_password": "Confirm New Password",
+  "cancel": "Cancel",
+  "confirm": "Confirm",
+  "yes": "Yes",
+  "no": "No",
+  "alert": "Alert",
+  "logout_alert": "Are you sure you want to logout?",
+  "account_deactivate_alert": "Are you sure you want to deactivate your account? You will not be able to login into the app once you proceed with the request.",
   "other": "Other"
 }

+ 8 - 1
packages/cs_resources/lib/l10n/intl_zh_CN.arb

@@ -74,11 +74,18 @@
   "account_deactivation": "删除账号",
   "rate_us": "评价我们",
   "version_no": "版本号.",
-  "Logout": "退出登录",
+  "logout": "退出登录",
   "old_mobile_phone": "旧的手机号码",
   "new_mobile_phone": "新的手机号码",
   "submit": "提交",
   "new_password": "新密码",
   "confirm_new_password": "确认新密码",
+  "cancel": "取消",
+  "confirm": "确认",
+  "yes": "是",
+  "no": "否",
+  "alert": "提示",
+  "logout_alert": "你确定要退出登录吗?",
+  "account_deactivate_alert": "您确定要停用您的帐户吗?一旦您继续执行请求,您将无法登录应用程序。",
   "other": "其他"
 }

+ 8 - 1
packages/cs_resources/lib/l10n/intl_zh_HK.arb

@@ -60,11 +60,18 @@
   "account_deactivation": "删除账号",
   "rate_us": "评价我们",
   "version_no": "版本号.",
-  "Logout": "退出登录",
+  "logout": "退出登录",
   "old_mobile_phone": "旧的手机号码",
   "new_mobile_phone": "新的手机号码",
   "submit": "提交",
   "new_password": "新密码",
   "confirm_new_password": "确认新密码",
+  "cancel": "取消",
+  "confirm": "确认",
+  "yes": "是",
+  "no": "否",
+  "alert": "提示",
+  "logout_alert": "你确定要退出登录吗?",
+  "account_deactivate_alert": "您确定要停用您的帐户吗?一旦您继续执行请求,您将无法登录应用程序。",
   "other": "其他"
 }

+ 5 - 0
packages/cs_resources/lib/theme/app_colors_theme.dart

@@ -50,6 +50,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
   final Color imgGrayBg; //灰色的图片底色背景
   final Color textDarkGray999; //文本深灰色
   final Color whiteBG; //按钮的白色色背景
+  final Color whiteSecondBG; //按钮的白色色背景
 
   // 私有的构造函数
   const AppColorsTheme._internal({
@@ -71,6 +72,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
     required this.imgGrayBg,
     required this.textDarkGray999,
     required this.whiteBG,
+    required this.whiteSecondBG,
   });
 
   // 浅色主题工厂方法
@@ -94,6 +96,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       imgGrayBg: _colorF3F3F3,
       textDarkGray999: _color999999,
       whiteBG: Colors.white,
+      whiteSecondBG: Colors.white,
     );
   }
 
@@ -118,6 +121,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       imgGrayBg: _darkBlackItem,
       textDarkGray999: Colors.white,
       whiteBG: _darkBlackItem,
+      whiteSecondBG: _darkBlackItemLight,
     );
   }
 
@@ -151,6 +155,7 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       imgGrayBg: Color.lerp(imgGrayBg, other.imgGrayBg, t)!,
       textDarkGray999: Color.lerp(textDarkGray999, other.textDarkGray999, t)!,
       whiteBG: Color.lerp(whiteBG, other.whiteBG, t)!,
+      whiteSecondBG: Color.lerp(whiteSecondBG, other.whiteSecondBG, t)!,
     );
   }
 }

+ 1 - 0
packages/cs_resources/pubspec.yaml

@@ -29,6 +29,7 @@ flutter:
     - assets/base_service/
     - assets/property/
     - assets/auth/
+    - assets/main/
 
 
 flutter_intl:

+ 83 - 50
packages/cs_widgets/lib/dialog/app_default_dialog.dart

@@ -1,28 +1,39 @@
+import 'package:cs_resources/generated/assets.dart';
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 import 'package:widgets/ext/ex_widget.dart';
-import 'package:cs_resources/constants/color_constants.dart';
+import 'package:widgets/my_load_image.dart';
 import '../my_text_view.dart';
-import '../no_shadow_scroll_behavior.dart';
 import 'dart:ui';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/widgets.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../no_shadow_scroll_behavior.dart';
+
 /*
  * 默认的弹窗
  */
 class AppDefaultDialog extends StatelessWidget {
-  String title;
+  String? title;
+
   String message;
   VoidCallback confirmAction;
   VoidCallback? cancelAction;
+  bool isShowCancelBtn;
+  String? confirmTxt;
+  String? cancelTxt;
 
   AppDefaultDialog({
-    required this.title,
     required this.message,
     required this.confirmAction,
+    this.title,
     this.cancelAction,
+    this.isShowCancelBtn = true,
+    this.confirmTxt,
+    this.cancelTxt,
   });
 
   @override
@@ -35,29 +46,52 @@ class AppDefaultDialog extends StatelessWidget {
         //Title (如果使用 Container 为最外层容器则默认为 match_parent 的效果,除非我们限制宽度和最大高度最小高度)
         Container(
           width: double.infinity,
-          decoration: const BoxDecoration(
-            color: Colors.white,
-            borderRadius: BorderRadius.all(Radius.circular(15)),
+          height: 55,
+          decoration: BoxDecoration(
+            color: context.appColors.btnBgDefault,
+            borderRadius: const BorderRadius.only(
+              topRight: Radius.circular(15),
+              topLeft: Radius.circular(15),
+            ),
           ),
-          child: Column(
+          child: Row(
             children: [
+              const SizedBox(width: 45),
               MyTextView(
-                title,
-                fontSize: 19,
+                title ?? S.current.alert,
+                fontSize: 18,
+                textAlign: TextAlign.center,
                 isFontMedium: true,
-                textColor: ColorConstants.black,
-                marginTop: 15,
-                marginBottom: 15,
-              ),
+                textColor: Colors.white,
+              ).expanded(),
+              const MyAssetImage(Assets.baseServiceDialogDeleteIcon,width: 25,height: 25.5,).onTap((){
+                onCancel();
+              },padding: 10)
+            ],
 
+          ),
+        ),
+
+        Container(
+          width: double.infinity,
+          padding: const EdgeInsets.only(top: 30),
+          decoration: BoxDecoration(
+            color: context.appColors.whiteSecondBG,
+            borderRadius: const BorderRadius.only(
+              bottomLeft: Radius.circular(15),
+              bottomRight: Radius.circular(15),
+            ),
+          ),
+          child: Column(
+            children: [
               Scrollbar(
                 child: ScrollConfiguration(
                   behavior: NoShadowScrollBehavior(),
                   child: SingleChildScrollView(
                     child: MyTextView(
                       message,
-                      fontSize: 16,
-                      textColor: Colors.black,
+                      fontSize: 18,
+                      textColor: context.appColors.textBlack,
                       isFontRegular: true,
                       textAlign: TextAlign.center,
                       paddingLeft: 30,
@@ -66,35 +100,31 @@ class AppDefaultDialog extends StatelessWidget {
                   ),
                 ),
               ).constrained(maxHeight: 210),
-
-
-              Container(
-                margin: EdgeInsets.only(top: 25),
-                color: Color(0XFFCECECE),
-                height: 0.5,
-              ),
               Row(
                 children: [
-                  Expanded(
-                      flex: 1,
-                      child: InkWell(
-                        onTap: () {
-                          onCancel();
-                          cancelAction?.call();
-                        },
-                        child: MyTextView(
-                          "Cancel",
-                          fontSize: 17.5,
-                          isFontMedium: true,
-                          textAlign: TextAlign.center,
-                          textColor: Color(0XFF0085C4),
-                          cornerRadius: 3,
-                          borderWidth: 1,
-                        ),
-                      )),
-                  Container(
-                    color: Color(0xff09141F).withOpacity(0.13),
-                    width: 0.5,
+                  const SizedBox(width: 18),
+                  Visibility(
+                    visible: isShowCancelBtn,
+                    child: Expanded(
+                        flex: 1,
+                        child: InkWell(
+                          onTap: () {
+                            onCancel();
+                            cancelAction?.call();
+                          },
+                          child: MyTextView(
+                            cancelTxt ?? S.current.no,
+                            fontSize: 16,
+                            isFontMedium: true,
+                            paddingTop: 13,
+                            marginRight: 15,
+                            paddingBottom: 13,
+                            textAlign: TextAlign.center,
+                            textColor: Colors.white,
+                            backgroundColor: context.appColors.orangeBG,
+                            cornerRadius: 7,
+                          ),
+                        )),
                   ),
                   Expanded(
                       flex: 1,
@@ -104,22 +134,25 @@ class AppDefaultDialog extends StatelessWidget {
                           confirmAction();
                         },
                         child: MyTextView(
-                          "Confirm",
-                          marginLeft: 10,
-                          fontSize: 17.5,
+                          confirmTxt ?? S.current.yes,
+                          fontSize: 16,
+                          paddingTop: 13,
+                          paddingBottom: 13,
                           isFontMedium: true,
                           textAlign: TextAlign.center,
-                          textColor: Color(0XFF0085C4),
-                          cornerRadius: 3,
+                          textColor: Colors.white,
+                          backgroundColor: context.appColors.btnBgDefault,
+                          cornerRadius: 7,
                         ),
                       )),
+                  const SizedBox(width: 18),
                 ],
-              ).constrained(height: 46),
+              ).marginOnly(bottom: 30, top: 28),
             ],
           ),
         ),
       ],
-    ).constrained(width: 295);
+    ).constrained(width: 300);
   }
 
   //取消弹框