Browse Source

调整部分底层控件样式
添加基本的黑白颜色样式与国际化文本
登录的页面

liukai 2 weeks ago
parent
commit
fb036f55e2
44 changed files with 831 additions and 200 deletions
  1. 63 75
      app/lib/main.dart
  2. 1 1
      melos.yaml
  3. 231 0
      packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart
  4. 68 0
      packages/cpt_auth/lib/modules/auth_login/auth_login_state.dart
  5. 129 0
      packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart
  6. 3 3
      packages/cpt_auth/lib/modules/auth_login/vm/auth_login_view_model.g.dart
  7. 0 34
      packages/cpt_auth/lib/modules/auth_login/page/Profile_edit_page.dart
  8. 0 14
      packages/cpt_auth/lib/modules/auth_login/vm/auth_login_view_model.dart
  9. 1 1
      packages/cpt_auth/lib/router/component/auth_component_service.dart
  10. 2 1
      packages/cpt_auth/lib/router/page/auth_page_router.dart
  11. 50 0
      packages/cpt_main/lib/modules/main/page/main_page.dart
  12. 2 1
      packages/cpt_main/lib/modules/visitor/page/visitor_page.dart
  13. BIN
      packages/cs_resources/assets/auth/choose_estate_building.webp
  14. BIN
      packages/cs_resources/assets/auth/country_sg.webp
  15. BIN
      packages/cs_resources/assets/auth/forgot_input_email_phone_img.webp
  16. BIN
      packages/cs_resources/assets/auth/forgot_reset_password_img.webp
  17. BIN
      packages/cs_resources/assets/auth/image_add_icon.webp
  18. BIN
      packages/cs_resources/assets/auth/password_hide.webp
  19. BIN
      packages/cs_resources/assets/auth/password_show.webp
  20. BIN
      packages/cs_resources/assets/auth/sign_up_input_img.webp
  21. BIN
      packages/cs_resources/assets/auth/sign_up_success_img.webp
  22. BIN
      packages/cs_resources/assets/auth/sign_up_unit_img.webp
  23. BIN
      packages/cs_resources/assets/auth/sms_verify_img.webp
  24. BIN
      packages/cs_resources/assets/auth/yy_home_success.webp
  25. BIN
      packages/cs_resources/assets/base_service/check_box_checked.webp
  26. BIN
      packages/cs_resources/assets/base_service/check_box_uncheck.webp
  27. BIN
      packages/cs_resources/assets/base_service/triangle_drop_down_icon.webp
  28. BIN
      packages/cs_resources/assets/yy_home_logo.webp
  29. 13 0
      packages/cs_resources/lib/generated/assets.dart
  30. 12 1
      packages/cs_resources/lib/generated/intl/messages_en.dart
  31. 10 1
      packages/cs_resources/lib/generated/intl/messages_zh_CN.dart
  32. 10 1
      packages/cs_resources/lib/generated/intl/messages_zh_HK.dart
  33. 80 0
      packages/cs_resources/lib/generated/l10n.dart
  34. 9 1
      packages/cs_resources/lib/l10n/intl_en.arb
  35. 9 1
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  36. 9 1
      packages/cs_resources/lib/l10n/intl_zh_HK.arb
  37. 35 4
      packages/cs_resources/lib/theme/app_colors_theme.dart
  38. 14 1
      packages/cs_resources/lib/theme/theme_config.dart
  39. 1 0
      packages/cs_resources/pubspec.yaml
  40. 15 11
      packages/cs_widgets/lib/ext/ex_widget.dart
  41. 18 15
      packages/cs_widgets/lib/my_appbar.dart
  42. 40 27
      packages/cs_widgets/lib/my_button.dart
  43. 5 5
      packages/cs_widgets/lib/my_text_field.dart
  44. 1 1
      packages/cs_widgets/lib/shatter/custom_check_box.dart

+ 63 - 75
app/lib/main.dart

@@ -136,17 +136,11 @@ class MyApp extends HookConsumerWidget {
           systemUiOverlayStyle = ThemeConfig.systemUiOverlayStyleDarkTheme;
           systemUiOverlayStyle = ThemeConfig.systemUiOverlayStyleDarkTheme;
           break;
           break;
         default:
         default:
-          Brightness currentBrightness = MediaQuery.of(context).platformBrightness;
-          if (currentBrightness == Brightness.dark) {
-            Log.d("main.dart - 跟随系统模式-暗色模式");
-            systemUiOverlayStyle = ThemeConfig.systemUiOverlayStyleDarkTheme;
-          } else {
-            Log.d("main.dart - 跟随系统模式-亮色模式");
-            systemUiOverlayStyle = ThemeConfig.systemUiOverlayStyleLightThemeBlack;
-          }
+          systemUiOverlayStyle = ThemeConfig.getSystemUiOverlayStyleByTheme(context);
           break;
           break;
       }
       }
     }
     }
+
     SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
     SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
 
 
     useEffect(() {
     useEffect(() {
@@ -160,78 +154,72 @@ class MyApp extends HookConsumerWidget {
       };
       };
     }, []);
     }, []);
 
 
-    //全局入口
-    // return AnnotatedRegion<SystemUiOverlayStyle>(
-    //   value: systemUiOverlayStyle,
-    //   child:
-
-   return   KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) {
-        return KeyboardDismissOnTap(
-          dismissOnCapturedTaps: false,
-          child: MaterialApp.router(
-            title: 'PropertyManagementSystem',
-            debugShowCheckedModeBanner: true,
+    return KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) {
+      return KeyboardDismissOnTap(
+        dismissOnCapturedTaps: false,
+        child: MaterialApp.router(
+          title: 'PropertyManagementSystem',
+          debugShowCheckedModeBanner: true,
 
 
-            //主题配置
-            theme: ThemeData(
-              colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF4161D0)),
-              useMaterial3: false,
-            ).copyWith(extensions: [
-              AppColorsTheme.light(),
-            ]),
-            darkTheme: ThemeData(
-              colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF4161D0), brightness: Brightness.dark),
-              useMaterial3: false,
-            ).copyWith(extensions: [
-              AppColorsTheme.dark(),
-            ]),
-            themeMode: themeMode == ThemeMode.system ? ThemeMode.system : themeMode,
+          //主题配置
+          theme: ThemeData(
+            colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF4161D0)),
+            useMaterial3: false,
+          ).copyWith(extensions: [
+            AppColorsTheme.light(),
+          ]),
+          darkTheme: ThemeData(
+            colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF4161D0), brightness: Brightness.dark),
+            useMaterial3: false,
+          ).copyWith(extensions: [
+            AppColorsTheme.dark(),
+          ]),
+          themeMode: themeMode == ThemeMode.system ? ThemeMode.system : themeMode,
 
 
-            //国际化配置
-            localizationsDelegates: const [
-              S.delegate,
-              GlobalMaterialLocalizations.delegate,
-              GlobalCupertinoLocalizations.delegate,
-              GlobalWidgetsLocalizations.delegate,
-            ],
-            //国际化英语为首选项
-            supportedLocales: [const Locale('en', ''), ...S.delegate.supportedLocales],
-            localeResolutionCallback: (locale, supportLocales) {
-              // 中文 简繁体处理
-              if (locale?.languageCode == 'zh') {
-                if (locale?.scriptCode == 'Hant') {
-                  return const Locale('zh', 'HK'); //繁体
-                } else {
-                  return const Locale('zh', 'CN'); //简体
-                }
+          //国际化配置
+          localizationsDelegates: const [
+            S.delegate,
+            GlobalMaterialLocalizations.delegate,
+            GlobalCupertinoLocalizations.delegate,
+            GlobalWidgetsLocalizations.delegate,
+          ],
+          //国际化英语为首选项
+          supportedLocales: [const Locale('en', ''), ...S.delegate.supportedLocales],
+          localeResolutionCallback: (locale, supportLocales) {
+            // 中文 简繁体处理
+            if (locale?.languageCode == 'zh') {
+              if (locale?.scriptCode == 'Hant') {
+                return const Locale('zh', 'HK'); //繁体
+              } else {
+                return const Locale('zh', 'CN'); //简体
               }
               }
-              return null;
+            }
+            return null;
+          },
+          //AutoRouter的配置
+          routerConfig: appRouter.config(
+            navigatorObservers: () => [
+              MyNavigatorObserver(),
+            ],
+          ),
+          //SmartDialog初始化默认Loading与Toast
+          builder: FlutterSmartDialog.init(
+            toastBuilder: (String msg) {
+              return CustomToastWidget(msg: msg);
             },
             },
-            //AutoRouter的配置
-            routerConfig: appRouter.config(
-              navigatorObservers: () => [
-                MyNavigatorObserver(),
-              ],
-            ),
-            //SmartDialog初始化默认Loading与Toast
-            builder: FlutterSmartDialog.init(
-              toastBuilder: (String msg) {
-                return CustomToastWidget(msg: msg);
-              },
-              loadingBuilder: (String msg) {
-                return CustomLoadingWidget(msg: msg == 'loading...' ? 'Loading...' : msg);
-              },
-              notifyStyle: FlutterSmartNotifyStyle(
-                successBuilder: (String msg) => CustomSuccessWidget(msg: msg),
-                failureBuilder: (String msg) => CustomFailureWidget(msg: msg),
-                errorBuilder: (String msg) => CustomErrorWidget(msg: msg),
-                alertBuilder: (String msg) => CustomErrorWidget(msg: msg),
-                warningBuilder: (String msg) => CustomErrorWidget(msg: msg),
-              ),
+            loadingBuilder: (String msg) {
+              return CustomLoadingWidget(msg: msg == 'loading...' ? 'Loading...' : msg);
+            },
+            notifyStyle: FlutterSmartNotifyStyle(
+              successBuilder: (String msg) => CustomSuccessWidget(msg: msg),
+              failureBuilder: (String msg) => CustomFailureWidget(msg: msg),
+              errorBuilder: (String msg) => CustomErrorWidget(msg: msg),
+              alertBuilder: (String msg) => CustomErrorWidget(msg: msg),
+              warningBuilder: (String msg) => CustomErrorWidget(msg: msg),
             ),
             ),
           ),
           ),
-        );
-      });
-    // );
+        ),
+      );
+    });
   }
   }
 }
 }

+ 1 - 1
melos.yaml

@@ -44,7 +44,7 @@ scripts:
         - build_runner
         - build_runner
 
 
   build_runner_auth:
   build_runner_auth:
-    run: cd "$MELOS_ROOT_PATH/packages/cpt_auth" && dart run build_runner build
+    run: cd "$MELOS_ROOT_PATH/packages/cpt_auth" && dart run build_runner build --delete-conflicting-outputs
     description: Run `dart run build_runner build` in auth module
     description: Run `dart run build_runner build` in auth module
 
 
   build_runner_community:
   build_runner_community:

+ 231 - 0
packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart

@@ -0,0 +1,231 @@
+import 'package:cpt_auth/modules/auth_login/auth_login_state.dart';
+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/gestures.dart';
+import 'package:flutter/material.dart';
+import 'package:auto_route/auto_route.dart';
+import 'package:hooks_riverpod/hooks_riverpod.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_load_image.dart';
+import 'package:widgets/my_text_field.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/shatter/custom_check_box.dart';
+import 'package:widgets/widget_export.dart';
+
+import '../../router/page/auth_page_router.dart';
+import 'auth_login_view_model.dart';
+
+/*
+ * 用户的登录页面
+ */
+@RoutePage()
+class AuthLoginPage extends HookConsumerWidget {
+  const AuthLoginPage({Key? key}) : super(key: key);
+
+  //启动当前页面
+  static void startInstance({BuildContext? context}) {
+    if (context != null) {
+      context.router.push(const AuthLoginPageRoute());
+    } else {
+      appRouter.push(const AuthLoginPageRoute());
+    }
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final viewModel = ref.read(authLoginViewModelProvider.notifier);
+    final state = ref.watch(authLoginViewModelProvider);
+
+    return Scaffold(
+      appBar: MyAppBar.appBar(context, "", showBackButton: false),
+      backgroundColor: context.appColors.backgroundDefault,
+      body: SingleChildScrollView(
+        scrollDirection: Axis.vertical,
+        physics: const BouncingScrollPhysics(),
+        child: Container(
+          margin: const EdgeInsets.symmetric(horizontal: 38),
+          width: double.infinity,
+          child: Column(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              //顶部Logo
+              const MyAssetImage(
+                Assets.assetsYyHomeLogo,
+                width: 85.5,
+                height: 85.5,
+              ).marginOnly(top: 45, bottom: 45),
+
+              // 登录表单 - 账号
+              _buildInputLayout(
+                context,
+                state,
+                "account",
+                textInputAction: TextInputAction.next,
+                errorText: state.accountErrorText,
+                onSubmit: (formKey, value) {
+                  state.formData[formKey]!['focusNode'].unfocus();
+                  FocusScope.of(context).requestFocus(state.formData['password']!['focusNode']);
+                },
+              ),
+
+              // 登录表单 - 密码
+              _buildInputLayout(
+                context,
+                state,
+                "password",
+                marginTop: 15,
+                obscureText: !state.pwdVisibility,
+                errorText: state.passwordErrorText,
+                showRightIcon: true,
+                rightWidget: IconButton(
+                  highlightColor: Colors.transparent,
+                  splashColor: Colors.transparent,
+                  icon: state.pwdVisibility
+                      ? const MyAssetImage(
+                          Assets.authPasswordHide,
+                          width: 22.5,
+                          height: 16.5,
+                        )
+                      : const MyAssetImage(
+                          Assets.authPasswordShow,
+                          width: 22.5,
+                          height: 16.5,
+                        ),
+                  onPressed: () {
+                    viewModel.switchPwdVisibility();
+                  },
+                ),
+                onSubmit: (formKey, value) {
+                  state.formData[formKey]!['focusNode'].unfocus();
+                  viewModel.doLogin();
+                },
+              ),
+
+              //登录按钮
+              MyButton(
+                onPressed: viewModel.doLogin,
+                text: S.current.login,
+                isEnabled: state.isLoginBtnEnable,
+                textColor: Colors.white,
+                disabledTextColor: Colors.white,
+                backgroundColor: context.appColors.btnBgDefault,
+                disabledBackgroundColor: context.appColors.btnBgDefault.withOpacity(0.2),
+                fontWeight: FontWeight.w500,
+                type: ClickType.throttle,
+                minHeight: 50,
+                radius: 5,
+              ).marginOnly(top: 20, bottom: 23),
+
+              //忘记密码
+              MyTextView(
+                S.current.forgot_password,
+                isFontMedium: true,
+                fontSize: 16,
+                textColor: context.appColors.textPrimary,
+                onClick: viewModel.gotoForgotPage,
+              ),
+
+              //创建账户-注册
+              MyButton(
+                onPressed: viewModel.gotoSignUpPage,
+                text: S.current.create_new_yy_home_account,
+                textColor: Colors.white,
+                backgroundColor: context.appColors.btnBgDefault,
+                fontWeight: FontWeight.w500,
+                type: ClickType.throttle,
+                minHeight: 50,
+                radius: 5,
+              ).marginOnly(top: 28, bottom: 30),
+
+              //同意协议
+              Row(
+                mainAxisSize: MainAxisSize.min,
+                children: [
+                  MyAssetImage(
+                    state.isAgreeTerms ? Assets.baseServiceCheckBoxChecked : Assets.baseServiceCheckBoxUncheck,
+                    width: 15.5,
+                    height: 15.5,
+                  ).onTap(viewModel.switchAgreeTerms, padding: 10),
+                  RichText(
+                    text: TextSpan(
+                      children: [
+                        TextSpan(
+                          text: S.current.agree_to,
+                          style: TextStyle(color: context.appColors.textDarkGray, fontWeight: FontWeight.w500, fontSize: 15), // 灰色文本
+                        ),
+                        const TextSpan(
+                          text: " ",
+                        ),
+                        TextSpan(
+                          text: S.current.terms_of_service,
+                          style: TextStyle(color: context.appColors.textPrimary, fontWeight: FontWeight.w500, fontSize: 15), // 蓝色文本
+                          recognizer: TapGestureRecognizer()..onTap = viewModel.gotoTermsPage,
+                        ),
+                      ],
+                    ),
+                  ),
+                ],
+              ),
+
+              //结束
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+
+  /// 输入框 账号与密码
+  Widget _buildInputLayout(
+    BuildContext context,
+    LoginState state,
+    String key, {
+    double marginTop = 0,
+    bool? showRightIcon = false, //是否展示右侧的布局
+    Widget? rightWidget, //右侧的布局
+    TextInputType textInputType = TextInputType.text,
+    String? errorText,
+    bool obscureText = false,
+    TextInputAction textInputAction = TextInputAction.done,
+    Function? onSubmit,
+  }) {
+    return IgnoreKeyboardDismiss(
+      child: MyTextField(
+        key,
+        fillBackgroundColor: context.appColors.authFiledBG,
+        state.formData[key]!['value'],
+        hintText: state.formData[key]!['hintText'],
+        hintStyle: TextStyle(
+          color: context.appColors.authFiledHint,
+          fontSize: 16.0,
+          fontWeight: FontWeight.w500,
+        ),
+        controller: state.formData[key]!['controller'],
+        focusNode: state.formData[key]!['focusNode'],
+        margin: EdgeInsets.only(top: marginTop),
+        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
+        showDivider: false,
+        height: 44,
+        style: TextStyle(
+          color: context.appColors.authFiledText,
+          fontSize: 16.0,
+          fontWeight: FontWeight.w500,
+        ),
+        inputType: textInputType,
+        textInputAction: textInputAction,
+        onSubmit: onSubmit,
+        cursorColor: context.appColors.authFiledText,
+        obscureText: obscureText,
+        errorText: errorText,
+        showLeftIcon: true,
+        showRightIcon: showRightIcon,
+        rightWidget: rightWidget,
+      ),
+    );
+  }
+}

+ 68 - 0
packages/cpt_auth/lib/modules/auth_login/auth_login_state.dart

@@ -0,0 +1,68 @@
+/*
+ * 登录的状态类
+ */
+import 'package:cs_resources/generated/l10n.dart';
+import 'package:flutter/material.dart';
+
+class LoginState {
+  //表单的校验与数据
+  final Map<String, Map<String, dynamic>> formData;
+
+  //表单的错误信息展示
+  String? accountErrorText;
+  String? passwordErrorText;
+
+  //是否明文展示密码
+  bool pwdVisibility;
+
+  //登录按钮是否可用
+  bool isLoginBtnEnable;
+
+  bool isAgreeTerms;
+
+  // ===================================  Begin  ↓  ===================================
+
+  LoginState({
+    Map<String, Map<String, dynamic>>? formData,
+    this.accountErrorText,
+    this.passwordErrorText,
+    this.pwdVisibility = false,
+    this.isLoginBtnEnable = false,
+    this.isAgreeTerms = false,
+  }) : formData = formData ??
+            {
+              'account': {
+                'value': '',
+                'controller': TextEditingController(),
+                'hintText': S.current.phone_email,
+                'focusNode': FocusNode(),
+                'obsecure': false,
+              },
+              'password': {
+                'value': '',
+                'controller': TextEditingController(),
+                'hintText': S.current.password,
+                'focusNode': FocusNode(),
+                'obsecure': true,
+              },
+            };
+
+  LoginState copyWith({
+    String? accountErrorText,
+    String? passwordErrorText,
+    String? account,
+    String? password,
+    bool? pwdVisibility,
+    bool? isLoginBtnEnable,
+    bool? isAgreeTerms,
+  }) {
+    return LoginState(
+      formData: this.formData,
+      accountErrorText: accountErrorText,
+      passwordErrorText: passwordErrorText,
+      pwdVisibility: pwdVisibility ?? this.pwdVisibility,
+      isLoginBtnEnable: isLoginBtnEnable ?? this.isLoginBtnEnable,
+      isAgreeTerms: isAgreeTerms ?? this.isLoginBtnEnable,
+    );
+  }
+}

+ 129 - 0
packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart

@@ -0,0 +1,129 @@
+import 'package:flutter/material.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+import 'package:shared/utils/util.dart';
+
+import 'auth_login_state.dart';
+
+part 'auth_login_view_model.g.dart';
+
+@riverpod
+class AuthLoginViewModel extends _$AuthLoginViewModel {
+  @override
+  LoginState build() {
+    final state = LoginState();
+
+    initListener(state);
+    ref.onDispose(() {
+      onDispose(state);
+    });
+    return state;
+  }
+
+  //切换是否隐藏密码
+  void switchPwdVisibility() {
+    state = state.copyWith(pwdVisibility: !state.pwdVisibility);
+  }
+
+  //执行用户的登录
+  void doLogin() {
+    state = state.copyWith(accountErrorText: null, passwordErrorText: null);
+
+    final FocusNode accountFocusNode = state.formData['account']!['focusNode'];
+    final FocusNode passwordFocusNode = state.formData['password']!['focusNode'];
+    final TextEditingController accountController = state.formData['account']!['controller'];
+    final TextEditingController passwordController = state.formData['password']!['controller'];
+
+    accountFocusNode.unfocus();
+    passwordFocusNode.unfocus();
+
+    final account = accountController.text;
+    final password = passwordController.text;
+
+    Log.d('当前待提交的 账号:${account} password:${password}');
+
+    if (Utils.isEmpty(account)) {
+      state = state.copyWith(accountErrorText: "The Phone/Email cannot be empty!");
+      return;
+    }
+
+    if (Utils.isEmpty(password)) {
+      state = state.copyWith(passwordErrorText: "The password cannot be empty!");
+      Log.d('The password cannot be empty!');
+      return;
+    }
+
+    //执行密码登录
+    ToastEngine.show('准备执行请求 账号:${account} password:${password}');
+  }
+
+  //去协议页面
+  void gotoTermsPage() {
+    ToastEngine.show("去协议页面");
+  }
+
+  //去忘记密码页面
+  void gotoForgotPage() {
+    ToastEngine.show("去忘记密码页面");
+  }
+
+  //去注册页面
+  void gotoSignUpPage() {
+    ToastEngine.show("去注册页面");
+  }
+
+  //切换同意按钮
+  void switchAgreeTerms(){
+    state = state.copyWith(isAgreeTerms: !state.isAgreeTerms);
+  }
+
+  //初始化监听
+  void initListener(LoginState initState) {
+    final FocusNode accountFocusNode = initState.formData['account']!['focusNode'];
+    final FocusNode passwordFocusNode = initState.formData['password']!['focusNode'];
+    final TextEditingController accountController = initState.formData['account']!['controller'];
+    final TextEditingController passwordController = initState.formData['password']!['controller'];
+
+    accountFocusNode.addListener(() {
+      // 获取焦点的时候清空错误文本
+      if (accountFocusNode.hasFocus) {
+        state = state.copyWith(accountErrorText: null);
+      }
+    });
+
+    passwordFocusNode.addListener(() {
+      // 获取焦点的时候清空错误文本
+      if (passwordFocusNode.hasFocus) {
+        state = state.copyWith(passwordErrorText: null);
+      }
+    });
+
+    //文本框的监听输入
+    accountController.addListener(() {
+      _updateButtonState(accountController, passwordController);
+    });
+
+    passwordController.addListener(() {
+      _updateButtonState(accountController, passwordController);
+    });
+  }
+
+  //当 Account 和 Password 都有值才能按钮可用
+  void _updateButtonState(TextEditingController accountController, TextEditingController passwordController) {
+    state = state.copyWith(isLoginBtnEnable: accountController.text.isNotEmpty && passwordController.text.isNotEmpty);
+  }
+
+  //销毁资源
+  void onDispose(LoginState initState) {
+    final FocusNode accountFocusNode = initState.formData['account']!['focusNode'];
+    final FocusNode passwordFocusNode = initState.formData['password']!['focusNode'];
+    final TextEditingController accountController = initState.formData['account']!['controller'];
+    final TextEditingController passwordController = initState.formData['password']!['controller'];
+    accountFocusNode.dispose();
+    passwordFocusNode.dispose();
+    accountController.dispose();
+    passwordController.dispose();
+  }
+
+}

+ 3 - 3
packages/cpt_auth/lib/modules/auth_login/vm/auth_login_view_model.g.dart

@@ -7,12 +7,12 @@ part of 'auth_login_view_model.dart';
 // **************************************************************************
 // **************************************************************************
 
 
 String _$authLoginViewModelHash() =>
 String _$authLoginViewModelHash() =>
-    r'10a37f5f6fead251c1df197123d10ce07fe0594c';
+    r'1ff8058ae78c878e2ab15e300ecf0d0457e73589';
 
 
 /// See also [AuthLoginViewModel].
 /// See also [AuthLoginViewModel].
 @ProviderFor(AuthLoginViewModel)
 @ProviderFor(AuthLoginViewModel)
 final authLoginViewModelProvider =
 final authLoginViewModelProvider =
-    AutoDisposeNotifierProvider<AuthLoginViewModel, void>.internal(
+    AutoDisposeNotifierProvider<AuthLoginViewModel, LoginState>.internal(
   AuthLoginViewModel.new,
   AuthLoginViewModel.new,
   name: r'authLoginViewModelProvider',
   name: r'authLoginViewModelProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
@@ -22,6 +22,6 @@ final authLoginViewModelProvider =
   allTransitiveDependencies: null,
   allTransitiveDependencies: null,
 );
 );
 
 
-typedef _$AuthLoginViewModel = AutoDisposeNotifier<void>;
+typedef _$AuthLoginViewModel = AutoDisposeNotifier<LoginState>;
 // ignore_for_file: type=lint
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 34
packages/cpt_auth/lib/modules/auth_login/page/Profile_edit_page.dart

@@ -1,34 +0,0 @@
-
-import 'package:flutter/material.dart';
-import 'package:auto_route/auto_route.dart';
-import 'package:hooks_riverpod/hooks_riverpod.dart';
-import 'package:router/ext/auto_router_extensions.dart';
-
-import '../../../router/page/auth_page_router.dart';
-import '../vm/auth_login_view_model.dart';
-
-@RoutePage()
-class AuthLoginPage extends HookConsumerWidget {
-  const AuthLoginPage({Key? key}) : super(key: key);
-
-  //启动当前页面
-  static void startInstance({BuildContext? context}) {
-    if (context != null) {
-      context.router.push(const AuthLoginPageRoute());
-    } else {
-      appRouter.push(const AuthLoginPageRoute());
-    }
-  }
-
-  @override
-  Widget build(BuildContext context, WidgetRef ref) {
-    final _viewModel = ref.read(authLoginViewModelProvider.notifier);
-
-    return Scaffold(
-      appBar: AppBar(title: Text("登录")),
-      body: Center(
-        child: Text("用户登录页面"),
-      ),
-    );
-  }
-}

+ 0 - 14
packages/cpt_auth/lib/modules/auth_login/vm/auth_login_view_model.dart

@@ -1,14 +0,0 @@
-
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-
-part 'auth_login_view_model.g.dart';
-
-@riverpod
-class AuthLoginViewModel extends _$AuthLoginViewModel {
-
-  @override
-  void build(){
-
-  }
-
-}

+ 1 - 1
packages/cpt_auth/lib/router/component/auth_component_service.dart

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 
 
-import '../../modules/auth_login/page/Profile_edit_page.dart';
+import '../../modules/auth_login/auth_login_page.dart';
 
 
 part 'auth_component_service.g.dart';
 part 'auth_component_service.g.dart';
 
 

+ 2 - 1
packages/cpt_auth/lib/router/page/auth_page_router.dart

@@ -3,7 +3,8 @@ import 'package:flutter/material.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:router/path/router_path.dart';
 import 'package:router/path/router_path.dart';
 
 
-import '../../modules/auth_login/page/Profile_edit_page.dart';
+import '../../modules/auth_login/auth_login_page.dart';
+
 
 
 
 
 part 'auth_page_router.gr.dart';
 part 'auth_page_router.gr.dart';

+ 50 - 0
packages/cpt_main/lib/modules/main/page/main_page.dart

@@ -1,3 +1,5 @@
+import 'package:cs_resources/theme/theme_config.dart';
+import 'package:flutter/services.dart';
 import 'package:flutter/src/widgets/framework.dart';
 import 'package:flutter/src/widgets/framework.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:auto_route/auto_route.dart';
@@ -23,6 +25,54 @@ class MainPage extends HookConsumerWidget {
 
 
   @override
   @override
   Widget build(BuildContext context, WidgetRef ref) {
   Widget build(BuildContext context, WidgetRef ref) {
+    // return AutoTabsRouter(
+    //   routes: const [
+    //     HomePageRoute(),
+    //     VisitorPageRoute(),
+    //     FeedbackPageRoute(),
+    //     MePageRoute(),
+    //   ],
+    //   transitionBuilder: (context, child, animation) => FadeTransition(
+    //     opacity: animation,
+    //     child: child,
+    //   ),
+    //   builder: (context, child) {
+    //     final tabsRouter = AutoTabsRouter.of(context);
+    //     return AnnotatedRegion<SystemUiOverlayStyle>(
+    //         value: ThemeConfig.getSystemUiOverlayStyleByTheme(context),
+    //         child: Scaffold(
+    //           body: child,
+    //           bottomNavigationBar: BottomNavigationBar(
+    //             backgroundColor: context.theme.primaryColor,
+    //             selectedItemColor: context.theme.colorScheme.secondary,
+    //             unselectedItemColor: Colors.grey[500],
+    //             elevation: 20,
+    //             type: BottomNavigationBarType.fixed,
+    //             items: const <BottomNavigationBarItem>[
+    //               BottomNavigationBarItem(
+    //                 icon: Icon(Icons.home),
+    //                 label: 'Home',
+    //               ),
+    //               BottomNavigationBarItem(
+    //                 icon: Icon(Icons.card_giftcard),
+    //                 label: 'Visitor',
+    //               ),
+    //               BottomNavigationBarItem(
+    //                 icon: Icon(Icons.feed),
+    //                 label: 'Feedback',
+    //               ),
+    //               BottomNavigationBarItem(
+    //                 icon: Icon(Icons.person),
+    //                 label: 'Me',
+    //               ),
+    //             ],
+    //             onTap: tabsRouter.setActiveIndex,
+    //             currentIndex: tabsRouter.activeIndex,
+    //           ),
+    //         ));
+    //   },
+    // );
+
     return AutoTabsScaffold(
     return AutoTabsScaffold(
       routes: const [
       routes: const [
         HomePageRoute(),
         HomePageRoute(),

+ 2 - 1
packages/cpt_main/lib/modules/visitor/page/visitor_page.dart

@@ -1,5 +1,6 @@
 import 'package:cpt_main/modules/visitor/vm/visitor_view_model.dart';
 import 'package:cpt_main/modules/visitor/vm/visitor_view_model.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:cs_resources/theme/theme_config.dart';
 import 'package:cs_resources/theme/theme_notifier.dart';
 import 'package:cs_resources/theme/theme_notifier.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
@@ -35,7 +36,7 @@ class VisitorPage extends HookConsumerWidget {
     Log.d("VisitorPage - build 了");
     Log.d("VisitorPage - build 了");
 
 
     return Scaffold(
     return Scaffold(
-      appBar: AppBar(title: Text("Visitor")),
+      appBar: AppBar(title: Text("Visitor"),systemOverlayStyle: ThemeConfig.getSystemUiOverlayStyleByTheme(context)),
       backgroundColor: context.appColors.backgroundDefault,
       backgroundColor: context.appColors.backgroundDefault,
       body: Center(
       body: Center(
         child: Column(
         child: Column(

BIN
packages/cs_resources/assets/auth/choose_estate_building.webp


BIN
packages/cs_resources/assets/auth/country_sg.webp


BIN
packages/cs_resources/assets/auth/forgot_input_email_phone_img.webp


BIN
packages/cs_resources/assets/auth/forgot_reset_password_img.webp


BIN
packages/cs_resources/assets/auth/image_add_icon.webp


BIN
packages/cs_resources/assets/auth/password_hide.webp


BIN
packages/cs_resources/assets/auth/password_show.webp


BIN
packages/cs_resources/assets/auth/sign_up_input_img.webp


BIN
packages/cs_resources/assets/auth/sign_up_success_img.webp


BIN
packages/cs_resources/assets/auth/sign_up_unit_img.webp


BIN
packages/cs_resources/assets/auth/sms_verify_img.webp


BIN
packages/cs_resources/assets/auth/yy_home_success.webp


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


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


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


BIN
packages/cs_resources/assets/yy_home_logo.webp


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

@@ -3,6 +3,19 @@ class Assets {
   Assets._();
   Assets._();
 
 
   static const String assetsYyBusinessTopLogo = 'assets/yy_business_top_logo.webp';
   static const String assetsYyBusinessTopLogo = 'assets/yy_business_top_logo.webp';
+  static const String assetsYyHomeLogo = 'assets/yy_home_logo.webp';
+  static const String authChooseEstateBuilding = 'assets/auth/choose_estate_building.webp';
+  static const String authCountrySg = 'assets/auth/country_sg.webp';
+  static const String authForgotInputEmailPhoneImg = 'assets/auth/forgot_input_email_phone_img.webp';
+  static const String authForgotResetPasswordImg = 'assets/auth/forgot_reset_password_img.webp';
+  static const String authImageAddIcon = 'assets/auth/image_add_icon.webp';
+  static const String authPasswordHide = 'assets/auth/password_hide.webp';
+  static const String authPasswordShow = 'assets/auth/password_show.webp';
+  static const String authSignUpInputImg = 'assets/auth/sign_up_input_img.webp';
+  static const String authSignUpSuccessImg = 'assets/auth/sign_up_success_img.webp';
+  static const String authSignUpUnitImg = 'assets/auth/sign_up_unit_img.webp';
+  static const String authSmsVerifyImg = 'assets/auth/sms_verify_img.webp';
+  static const String authYyHomeSuccess = 'assets/auth/yy_home_success.webp';
   static const String baseLibBlackBack = 'assets/base_lib/black_back.webp';
   static const String baseLibBlackBack = 'assets/base_lib/black_back.webp';
   static const String baseLibDialogBlueDeleteIcon = 'assets/base_lib/dialog_blue_delete_icon.webp';
   static const String baseLibDialogBlueDeleteIcon = 'assets/base_lib/dialog_blue_delete_icon.webp';
   static const String baseLibDialogDeleteIcon = 'assets/base_lib/dialog_delete_icon.webp';
   static const String baseLibDialogDeleteIcon = 'assets/base_lib/dialog_delete_icon.webp';

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

@@ -22,11 +22,22 @@ class MessageLookup extends MessageLookupByLibrary {
 
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
+        "agree_to": MessageLookupByLibrary.simpleMessage("Agree to"),
+        "create_new_yy_home_account":
+            MessageLookupByLibrary.simpleMessage("Create New YY Home Account"),
         "facility": MessageLookupByLibrary.simpleMessage("Facility"),
         "facility": MessageLookupByLibrary.simpleMessage("Facility"),
+        "forgot_password":
+            MessageLookupByLibrary.simpleMessage("Forgot Password?"),
         "form": MessageLookupByLibrary.simpleMessage("Form"),
         "form": MessageLookupByLibrary.simpleMessage("Form"),
+        "login": MessageLookupByLibrary.simpleMessage("Log In"),
         "notice_board": MessageLookupByLibrary.simpleMessage("Notice Board"),
         "notice_board": MessageLookupByLibrary.simpleMessage("Notice Board"),
         "notification": MessageLookupByLibrary.simpleMessage("Notification"),
         "notification": MessageLookupByLibrary.simpleMessage("Notification"),
+        "other": MessageLookupByLibrary.simpleMessage("Other"),
+        "password": MessageLookupByLibrary.simpleMessage("Password"),
         "payment": MessageLookupByLibrary.simpleMessage("Payment"),
         "payment": MessageLookupByLibrary.simpleMessage("Payment"),
-        "rewards": MessageLookupByLibrary.simpleMessage("Rewards")
+        "phone_email": MessageLookupByLibrary.simpleMessage("Phone/Email"),
+        "rewards": MessageLookupByLibrary.simpleMessage("Rewards"),
+        "terms_of_service":
+            MessageLookupByLibrary.simpleMessage("Terms of Service")
       };
       };
 }
 }

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

@@ -22,11 +22,20 @@ class MessageLookup extends MessageLookupByLibrary {
 
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
+        "agree_to": MessageLookupByLibrary.simpleMessage("同意"),
+        "create_new_yy_home_account":
+            MessageLookupByLibrary.simpleMessage("创建新的 YY Home 账户"),
         "facility": MessageLookupByLibrary.simpleMessage("设施"),
         "facility": MessageLookupByLibrary.simpleMessage("设施"),
+        "forgot_password": MessageLookupByLibrary.simpleMessage("忘记密码?"),
         "form": MessageLookupByLibrary.simpleMessage("表单"),
         "form": MessageLookupByLibrary.simpleMessage("表单"),
+        "login": MessageLookupByLibrary.simpleMessage("登录"),
         "notice_board": MessageLookupByLibrary.simpleMessage("消息板"),
         "notice_board": MessageLookupByLibrary.simpleMessage("消息板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
+        "other": MessageLookupByLibrary.simpleMessage("其他"),
+        "password": MessageLookupByLibrary.simpleMessage("密码"),
         "payment": MessageLookupByLibrary.simpleMessage("支付"),
         "payment": MessageLookupByLibrary.simpleMessage("支付"),
-        "rewards": MessageLookupByLibrary.simpleMessage("奖励")
+        "phone_email": MessageLookupByLibrary.simpleMessage("电话或邮箱"),
+        "rewards": MessageLookupByLibrary.simpleMessage("奖励"),
+        "terms_of_service": MessageLookupByLibrary.simpleMessage("服务条款")
       };
       };
 }
 }

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

@@ -22,11 +22,20 @@ class MessageLookup extends MessageLookupByLibrary {
 
 
   final messages = _notInlinedMessages(_notInlinedMessages);
   final messages = _notInlinedMessages(_notInlinedMessages);
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
   static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
+        "agree_to": MessageLookupByLibrary.simpleMessage("同意"),
+        "create_new_yy_home_account":
+            MessageLookupByLibrary.simpleMessage("创建新的 YY Home 账户"),
         "facility": MessageLookupByLibrary.simpleMessage("設施"),
         "facility": MessageLookupByLibrary.simpleMessage("設施"),
+        "forgot_password": MessageLookupByLibrary.simpleMessage("忘记密码?"),
         "form": MessageLookupByLibrary.simpleMessage("表單"),
         "form": MessageLookupByLibrary.simpleMessage("表單"),
+        "login": MessageLookupByLibrary.simpleMessage("登录"),
         "notice_board": MessageLookupByLibrary.simpleMessage("通知板"),
         "notice_board": MessageLookupByLibrary.simpleMessage("通知板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
+        "other": MessageLookupByLibrary.simpleMessage("其他"),
+        "password": MessageLookupByLibrary.simpleMessage("密码"),
         "payment": MessageLookupByLibrary.simpleMessage("支付"),
         "payment": MessageLookupByLibrary.simpleMessage("支付"),
-        "rewards": MessageLookupByLibrary.simpleMessage("獎勵")
+        "phone_email": MessageLookupByLibrary.simpleMessage("电话或邮箱"),
+        "rewards": MessageLookupByLibrary.simpleMessage("獎勵"),
+        "terms_of_service": MessageLookupByLibrary.simpleMessage("服务条款")
       };
       };
 }
 }

+ 80 - 0
packages/cs_resources/lib/generated/l10n.dart

@@ -109,6 +109,86 @@ class S {
       args: [],
       args: [],
     );
     );
   }
   }
+
+  /// `Phone/Email`
+  String get phone_email {
+    return Intl.message(
+      'Phone/Email',
+      name: 'phone_email',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Password`
+  String get password {
+    return Intl.message(
+      'Password',
+      name: 'password',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Log In`
+  String get login {
+    return Intl.message(
+      'Log In',
+      name: 'login',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Forgot Password?`
+  String get forgot_password {
+    return Intl.message(
+      'Forgot Password?',
+      name: 'forgot_password',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Create New YY Home Account`
+  String get create_new_yy_home_account {
+    return Intl.message(
+      'Create New YY Home Account',
+      name: 'create_new_yy_home_account',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Agree to`
+  String get agree_to {
+    return Intl.message(
+      'Agree to',
+      name: 'agree_to',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Terms of Service`
+  String get terms_of_service {
+    return Intl.message(
+      'Terms of Service',
+      name: 'terms_of_service',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Other`
+  String get other {
+    return Intl.message(
+      'Other',
+      name: 'other',
+      desc: '',
+      args: [],
+    );
+  }
 }
 }
 
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

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

@@ -4,5 +4,13 @@
   "notification": "Notification",
   "notification": "Notification",
   "facility": "Facility",
   "facility": "Facility",
   "form": "Form",
   "form": "Form",
-  "notice_board": "Notice Board"
+  "notice_board": "Notice Board",
+  "phone_email": "Phone/Email",
+  "password": "Password",
+  "login": "Log In",
+  "forgot_password": "Forgot Password?",
+  "create_new_yy_home_account": "Create New YY Home Account",
+  "agree_to": "Agree to",
+  "terms_of_service": "Terms of Service",
+  "other": "Other"
 }
 }

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

@@ -4,5 +4,13 @@
   "notification": "通知",
   "notification": "通知",
   "facility": "设施",
   "facility": "设施",
   "form": "表单",
   "form": "表单",
-  "notice_board": "消息板"
+  "notice_board": "消息板",
+  "phone_email": "电话或邮箱",
+  "password": "密码",
+  "login": "登录",
+  "forgot_password": "忘记密码?",
+  "create_new_yy_home_account": "创建新的 YY Home 账户",
+  "agree_to": "同意",
+  "terms_of_service": "服务条款",
+  "other": "其他"
 }
 }

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

@@ -4,5 +4,13 @@
   "notification": "通知",
   "notification": "通知",
   "facility": "設施",
   "facility": "設施",
   "form": "表單",
   "form": "表單",
-  "notice_board": "通知板"
+  "notice_board": "通知板",
+  "phone_email": "电话或邮箱",
+  "password": "密码",
+  "login": "登录",
+  "forgot_password": "忘记密码?",
+  "create_new_yy_home_account": "创建新的 YY Home 账户",
+  "agree_to": "同意",
+  "terms_of_service": "服务条款",
+  "other": "其他"
 }
 }

+ 35 - 4
packages/cs_resources/lib/theme/app_colors_theme.dart

@@ -14,8 +14,10 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
   static const _colorPrimary = Color(0xFF4161D0); //主题色
   static const _colorPrimary = Color(0xFF4161D0); //主题色
   static const _colorB0B0B0 = Color(0xFFB0B0B0);
   static const _colorB0B0B0 = Color(0xFFB0B0B0);
   static const _color6C6C6C = Color(0xFF6C6C6C);
   static const _color6C6C6C = Color(0xFF6C6C6C);
-  static const _colorF9F9F9 = Color(0xffF9F9F9);
+  static const _color666666 = Color(0xFF666666);
   static const _colorD7DBE7 = Color(0xffD7DBE7);
   static const _colorD7DBE7 = Color(0xffD7DBE7);
+  static const _colorBDBDBD = Color(0xFFBDBDBD);
+  static const _colorF2F2F2 = Color(0xFFF2F2F2);
 
 
   //暗色主题的一些自定义颜色值
   //暗色主题的一些自定义颜色值
   static const _darkBlackBg = Color(0xFF0F0F0F);
   static const _darkBlackBg = Color(0xFF0F0F0F);
@@ -26,23 +28,40 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
 
 
   // 页面中真正使用到的颜色名称
   // 页面中真正使用到的颜色名称
   final Color backgroundDefault; //页面背景颜色
   final Color backgroundDefault; //页面背景颜色
-  final Color btnBgDefault;
+  final Color btnBgDefault;  //按钮背景颜色
   final Color searchFiledBorder; //搜索框的边框颜色
   final Color searchFiledBorder; //搜索框的边框颜色
-
+  final Color authFiledHint; //输入框默认的提示文本颜色
+  final Color authFiledText; //输入框默认的文本颜色
+  final Color authFiledBG; //输入框默认的背景颜色
+  final Color textPrimary; //主题色文本
+  final Color textBlack; //黑色文本
+  final Color textDarkGray; //深灰色 666 文本
 
 
   // 私有的构造函数
   // 私有的构造函数
   const AppColorsTheme._internal({
   const AppColorsTheme._internal({
     required this.backgroundDefault,
     required this.backgroundDefault,
     required this.btnBgDefault,
     required this.btnBgDefault,
     required this.searchFiledBorder,
     required this.searchFiledBorder,
+    required this.authFiledHint,
+    required this.authFiledText,
+    required this.authFiledBG,
+    required this.textPrimary,
+    required this.textBlack,
+    required this.textDarkGray,
   });
   });
 
 
   // 浅色主题工厂方法
   // 浅色主题工厂方法
   factory AppColorsTheme.light() {
   factory AppColorsTheme.light() {
     return const AppColorsTheme._internal(
     return const AppColorsTheme._internal(
-      backgroundDefault: _colorF9F9F9,
+      backgroundDefault: Colors.white,
       btnBgDefault: _colorPrimary,
       btnBgDefault: _colorPrimary,
       searchFiledBorder: _colorD7DBE7,
       searchFiledBorder: _colorD7DBE7,
+      authFiledHint: _colorBDBDBD,
+      authFiledText: Colors.black,
+      authFiledBG: _colorF2F2F2,
+      textPrimary: _colorPrimary,
+      textBlack: Colors.black,
+      textDarkGray: _color666666,
     );
     );
   }
   }
 
 
@@ -52,6 +71,12 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       backgroundDefault: _darkBlackBg,
       backgroundDefault: _darkBlackBg,
       btnBgDefault: _darkBlackItem,
       btnBgDefault: _darkBlackItem,
       searchFiledBorder: _darkBlackItem,
       searchFiledBorder: _darkBlackItem,
+      authFiledHint: _colorD7DBE7,
+      authFiledText: Colors.white,
+      authFiledBG: _darkBlackItem,
+      textPrimary: Colors.white,
+      textBlack: Colors.white,
+      textDarkGray: Colors.white,
     );
     );
   }
   }
 
 
@@ -70,6 +95,12 @@ class AppColorsTheme extends ThemeExtension<AppColorsTheme> {
       backgroundDefault: Color.lerp(backgroundDefault, other.backgroundDefault, t)!,
       backgroundDefault: Color.lerp(backgroundDefault, other.backgroundDefault, t)!,
       btnBgDefault: Color.lerp(btnBgDefault, other.btnBgDefault, t)!,
       btnBgDefault: Color.lerp(btnBgDefault, other.btnBgDefault, t)!,
       searchFiledBorder: Color.lerp(searchFiledBorder, other.searchFiledBorder, t)!,
       searchFiledBorder: Color.lerp(searchFiledBorder, other.searchFiledBorder, t)!,
+      authFiledHint: Color.lerp(authFiledHint, other.authFiledHint, t)!,
+      authFiledText: Color.lerp(authFiledText, other.authFiledText, t)!,
+      authFiledBG: Color.lerp(authFiledBG, other.authFiledBG, t)!,
+      textPrimary: Color.lerp(textPrimary, other.textPrimary, t)!,
+      textBlack: Color.lerp(textBlack, other.textBlack, t)!,
+      textDarkGray: Color.lerp(textDarkGray, other.textDarkGray, t)!,
     );
     );
   }
   }
 }
 }

+ 14 - 1
packages/cs_resources/lib/theme/theme_config.dart

@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/services.dart';
 
 
 class ThemeConfig {
 class ThemeConfig {
-
   //亮色模式模式下的状态栏与导航栏设置 (默认黑色状态栏文本,白色导航栏)
   //亮色模式模式下的状态栏与导航栏设置 (默认黑色状态栏文本,白色导航栏)
   static SystemUiOverlayStyle get systemUiOverlayStyleLightThemeBlack {
   static SystemUiOverlayStyle get systemUiOverlayStyleLightThemeBlack {
     return SystemUiOverlayStyle.light.copyWith(
     return SystemUiOverlayStyle.light.copyWith(
@@ -42,4 +41,18 @@ class ThemeConfig {
     );
     );
   }
   }
 
 
+  //根据上下文的亮色模式和暗色模式返回对应的 SystemUiOverlay 配置
+  static SystemUiOverlayStyle getSystemUiOverlayStyleByTheme(BuildContext context) {
+    late SystemUiOverlayStyle systemUiOverlayStyle;
+
+    Brightness currentBrightness = MediaQuery.of(context).platformBrightness;
+    if (currentBrightness == Brightness.dark) {
+      systemUiOverlayStyle = systemUiOverlayStyleDarkTheme;
+    } else {
+      systemUiOverlayStyle = systemUiOverlayStyleLightThemeBlack;
+    }
+
+    return systemUiOverlayStyle;
+  }
+
 }
 }

+ 1 - 0
packages/cs_resources/pubspec.yaml

@@ -27,6 +27,7 @@ flutter:
     - assets/
     - assets/
     - assets/base_lib/
     - assets/base_lib/
     - assets/base_service/
     - assets/base_service/
+    - assets/auth/
 
 
 
 
 flutter_intl:
 flutter_intl:

+ 15 - 11
packages/cs_widgets/lib/ext/ex_widget.dart

@@ -491,25 +491,29 @@ extension ExWidget on Widget {
 
 
   /// 手势
   /// 手势
   Widget onTap(
   Widget onTap(
-    GestureTapCallback onTap, {
-    Key? key,
-    HitTestBehavior? behavior,
-    ClickType type = ClickType.none, //默认没有点击类型
-    int milliseconds = 500, //点击类型的时间戳(毫秒)
-    bool excludeFromSemantics = false,
-    DragStartBehavior dragStartBehavior = DragStartBehavior.start,
-  }) =>
+      GestureTapCallback onTap, {
+        Key? key,
+        HitTestBehavior? behavior,
+        ClickType type = ClickType.none,
+        int milliseconds = 500,
+        bool excludeFromSemantics = false,
+        DragStartBehavior dragStartBehavior = DragStartBehavior.start,
+        double padding = 0,  // 通过 padding 参数控制点击范围的扩展
+      }) =>
       GestureDetector(
       GestureDetector(
         key: key,
         key: key,
         onTap: type == ClickType.debounce
         onTap: type == ClickType.debounce
             ? onTap.debounce(milliseconds)
             ? onTap.debounce(milliseconds)
             : type == ClickType.throttle
             : type == ClickType.throttle
-                ? onTap.throttle(milliseconds)
-                : onTap,
+            ? onTap.throttle(milliseconds)
+            : onTap,
         behavior: behavior ?? HitTestBehavior.opaque,
         behavior: behavior ?? HitTestBehavior.opaque,
         excludeFromSemantics: excludeFromSemantics,
         excludeFromSemantics: excludeFromSemantics,
         dragStartBehavior: dragStartBehavior,
         dragStartBehavior: dragStartBehavior,
-        child: this,
+        child: Padding(
+          padding: EdgeInsets.all(padding),  // 通过 Padding 扩大点击区域
+          child: this,
+        ),
       );
       );
 
 
   /// 长按手势
   /// 长按手势

+ 18 - 15
packages/cs_widgets/lib/my_appbar.dart

@@ -1,3 +1,4 @@
+import 'package:cs_resources/theme/theme_config.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter/services.dart';
@@ -20,26 +21,28 @@ class MyAppBar {
       Color backgroundColor = Colors.transparent,
       Color backgroundColor = Colors.transparent,
       SystemUiOverlayStyle? systemUiOverlayStyle,
       SystemUiOverlayStyle? systemUiOverlayStyle,
       bool showBottomDivider = false,
       bool showBottomDivider = false,
+      bool showBackButton = true, //是否展示返回按钮
       List<Widget>? actions}) {
       List<Widget>? actions}) {
     // 检查当前主题是亮色还是暗色
     // 检查当前主题是亮色还是暗色
     final bool isDarkMode = Theme.of(context).brightness == Brightness.dark;
     final bool isDarkMode = Theme.of(context).brightness == Brightness.dark;
 
 
     return AppBar(
     return AppBar(
-      //设置变色与背景颜色一致,避免滚动的时候AppBar变色
       backgroundColor: backgroundColor,
       backgroundColor: backgroundColor,
       surfaceTintColor: backgroundColor,
       surfaceTintColor: backgroundColor,
-      systemOverlayStyle: systemUiOverlayStyle,
-      // 如果没有自带的返回按钮,直接使用系统自带的返回图标
-      leading: backIconPath != null
-          ? IconButton(
-              icon: MyAssetImage(
-                backIconPath,
-                width: backIconWidth ?? 11,
-                height: backIconHeight ?? 18,
-              ),
-              onPressed: backCallback,
-            )
-          : null,
+      systemOverlayStyle: systemUiOverlayStyle ?? ThemeConfig.getSystemUiOverlayStyleByTheme(context),
+      // 根据 showBackButton 参数决定是否显示返回按钮
+      leading: showBackButton
+          ? (backIconPath != null
+              ? IconButton(
+                  icon: MyAssetImage(
+                    backIconPath,
+                    width: backIconWidth ?? 11,
+                    height: backIconHeight ?? 18,
+                  ),
+                  onPressed: backCallback,
+                )
+              : null) // 使用系统默认返回按钮
+          : const SizedBox.shrink(),
       iconTheme: IconThemeData(color: isDarkMode ? Colors.white : Theme.of(context).colorScheme.primary),
       iconTheme: IconThemeData(color: isDarkMode ? Colors.white : Theme.of(context).colorScheme.primary),
       centerTitle: true,
       centerTitle: true,
       title: subTitle == null
       title: subTitle == null
@@ -64,7 +67,7 @@ class MyAppBar {
             ),
             ),
       actions: actions,
       actions: actions,
       elevation: 0.0,
       elevation: 0.0,
-      bottom: showBottomDivider // 根据变量控制 bottom 的显示
+      bottom: showBottomDivider
           ? const PreferredSize(
           ? const PreferredSize(
               preferredSize: Size.fromHeight(0.5),
               preferredSize: Size.fromHeight(0.5),
               child: Divider(
               child: Divider(
@@ -98,7 +101,7 @@ class MyAppBar {
     return AppBar(
     return AppBar(
       backgroundColor: backgroundColor,
       backgroundColor: backgroundColor,
       surfaceTintColor: backgroundColor,
       surfaceTintColor: backgroundColor,
-      systemOverlayStyle: systemUiOverlayStyle,
+      systemOverlayStyle: systemUiOverlayStyle ?? ThemeConfig.getSystemUiOverlayStyleByTheme(context),
       // 标题与其他控件的间隔
       // 标题与其他控件的间隔
       titleSpacing: 0,
       titleSpacing: 0,
       // 如果没有自带的返回按钮,直接使用系统自带的返回图标
       // 如果没有自带的返回按钮,直接使用系统自带的返回图标

+ 40 - 27
packages/cs_widgets/lib/my_button.dart

@@ -22,24 +22,25 @@ import 'package:shared/utils/ext_dart.dart';
 class MyButton extends StatelessWidget {
 class MyButton extends StatelessWidget {
   const MyButton({
   const MyButton({
     Key? key,
     Key? key,
-    required this.onPressed, //必选,点击回调
+    required this.onPressed,
     this.text = '',
     this.text = '',
     this.fontSize = 16,
     this.fontSize = 16,
     this.textColor,
     this.textColor,
     this.disabledTextColor,
     this.disabledTextColor,
     this.backgroundColor,
     this.backgroundColor,
     this.disabledBackgroundColor,
     this.disabledBackgroundColor,
-    this.minHeight = 43.0, //最高高度,默认43
-    this.minWidth = double.infinity, //最小宽度,默认充满控件
-    this.padding = const EdgeInsets.symmetric(horizontal: 16.0), //内间距,默认是横向内间距
-    this.radius = 5.0, //圆角
-    this.enableOverlay = true, //是否支持水波纹效果,不过这个效果对比InkWell比较克制,推荐开启
-    this.elevation = 0.0, //是否支持阴影,设置Z轴高度
-    this.shadowColor = Colors.black, //阴影的颜色
-    this.side = BorderSide.none, //边框的设置
+    this.minHeight = 43.0,
+    this.minWidth = double.infinity,
+    this.padding = const EdgeInsets.symmetric(horizontal: 16.0),
+    this.radius = 5.0,
+    this.enableOverlay = true,
+    this.elevation = 0.0,
+    this.shadowColor = Colors.black,
+    this.side = BorderSide.none,
     this.fontWeight,
     this.fontWeight,
     this.type = ClickType.none,
     this.type = ClickType.none,
     this.milliseconds = 500,
     this.milliseconds = 500,
+    this.isEnabled = true, // 控制按钮是否可用
   }) : super(key: key);
   }) : super(key: key);
 
 
   final String text;
   final String text;
@@ -58,42 +59,49 @@ class MyButton extends StatelessWidget {
   final double elevation;
   final double elevation;
   final Color? shadowColor;
   final Color? shadowColor;
   final FontWeight? fontWeight;
   final FontWeight? fontWeight;
-  final ClickType type; //默认没有点击类型
-  final int milliseconds; //点击类型的时间戳(毫秒)
+  final ClickType type;
+  final int milliseconds;
+  final bool isEnabled; // 控制按钮是否可用
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return TextButton(
     return TextButton(
-        onPressed: type == ClickType.debounce
+        onPressed: isEnabled
+            ? (type == ClickType.debounce
             ? onPressed?.debounce(milliseconds)
             ? onPressed?.debounce(milliseconds)
             : type == ClickType.throttle
             : type == ClickType.throttle
-                ? onPressed?.throttle(milliseconds)
-                : onPressed,
+            ? onPressed?.throttle(milliseconds)
+            : onPressed)
+            : null, // 如果按钮不可用,则 onPressed 设为 null
         style: ButtonStyle(
         style: ButtonStyle(
-          // 文字颜色
-          //               MaterialStateProperty.all            //各种状态都是这个颜色
           foregroundColor: MaterialStateProperty.resolveWith(
           foregroundColor: MaterialStateProperty.resolveWith(
-            //根据不同的状态展示不同的颜色
-            (states) {
+                (states) {
               if (states.contains(MaterialState.disabled)) {
               if (states.contains(MaterialState.disabled)) {
-                return DarkThemeUtil.multiColors(context,disabledTextColor ?? Colors.grey, darkColor: Colors.grey);
+                return DarkThemeUtil.multiColors(
+                    context, disabledTextColor ?? Colors.grey,
+                    darkColor: Colors.grey);
               }
               }
-              return DarkThemeUtil.multiColors(context,textColor ?? Colors.white, darkColor: Colors.white);
+              return DarkThemeUtil.multiColors(
+                  context, textColor ?? Colors.white,
+                  darkColor: Colors.white);
             },
             },
           ),
           ),
-          // 背景颜色
           backgroundColor: MaterialStateProperty.resolveWith((states) {
           backgroundColor: MaterialStateProperty.resolveWith((states) {
             if (states.contains(MaterialState.disabled)) {
             if (states.contains(MaterialState.disabled)) {
               return disabledBackgroundColor;
               return disabledBackgroundColor;
             }
             }
             return backgroundColor;
             return backgroundColor;
           }),
           }),
-          // 水波纹
           overlayColor: MaterialStateProperty.resolveWith((states) {
           overlayColor: MaterialStateProperty.resolveWith((states) {
-            return enableOverlay ? DarkThemeUtil.multiColors(context,textColor ?? Colors.white)?.withOpacity(0.12) : Colors.transparent;
+            return enableOverlay
+                ? DarkThemeUtil.multiColors(context, textColor ?? Colors.white)
+                ?.withOpacity(0.12)
+                : Colors.transparent;
           }),
           }),
-          // 按钮最小大小
-          minimumSize: (minWidth == null || minHeight == null) ? null : MaterialStateProperty.all<Size>(Size(minWidth!, minHeight!)),
+          minimumSize: (minWidth == null || minHeight == null)
+              ? null
+              : MaterialStateProperty.all<Size>(
+              Size(minWidth!, minHeight!)),
           padding: MaterialStateProperty.all<EdgeInsetsGeometry>(padding),
           padding: MaterialStateProperty.all<EdgeInsetsGeometry>(padding),
           shape: MaterialStateProperty.all<OutlinedBorder>(
           shape: MaterialStateProperty.all<OutlinedBorder>(
             RoundedRectangleBorder(
             RoundedRectangleBorder(
@@ -102,11 +110,16 @@ class MyButton extends StatelessWidget {
           ),
           ),
           side: MaterialStateProperty.all<BorderSide>(side),
           side: MaterialStateProperty.all<BorderSide>(side),
           elevation: MaterialStateProperty.all<double>(elevation),
           elevation: MaterialStateProperty.all<double>(elevation),
-          shadowColor: MaterialStateProperty.all<Color>(DarkThemeUtil.multiColors(context,shadowColor ?? Colors.black, darkColor: Colors.white)!),
+          shadowColor: MaterialStateProperty.all<Color>(
+              DarkThemeUtil.multiColors(
+                  context, shadowColor ?? Colors.black,
+                  darkColor: Colors.white)!),
         ),
         ),
         child: Text(
         child: Text(
           text,
           text,
-          style: TextStyle(fontSize: fontSize, fontWeight: fontWeight ?? FontWeight.w400),
+          style: TextStyle(
+              fontSize: fontSize, fontWeight: fontWeight ?? FontWeight.w400),
         ));
         ));
   }
   }
 }
 }
+

+ 5 - 5
packages/cs_widgets/lib/my_text_field.dart

@@ -79,7 +79,7 @@ class MyTextField extends StatelessWidget {
     this.obscureText = false, //是否隐藏文本,即显示密码类型
     this.obscureText = false, //是否隐藏文本,即显示密码类型
     this.height = 50.0,
     this.height = 50.0,
     this.fillBackgroundColor, //整体的背景颜色
     this.fillBackgroundColor, //整体的背景颜色
-    this.fillCornerRadius, //整体的背景颜色圆角
+    this.fillCornerRadius = 5.0, //整体的背景颜色圆角
     this.padding = EdgeInsets.zero, //整体布局的Padding
     this.padding = EdgeInsets.zero, //整体布局的Padding
     this.margin = EdgeInsets.zero, //整体布局的Margin
     this.margin = EdgeInsets.zero, //整体布局的Margin
     this.decoration, //自定义装饰
     this.decoration, //自定义装饰
@@ -127,7 +127,7 @@ class MyTextField extends StatelessWidget {
               focusNode: focusNode,
               focusNode: focusNode,
               obscureText: obscureText,
               obscureText: obscureText,
               cursorWidth: cursorWidth,
               cursorWidth: cursorWidth,
-              cursorColor: DarkThemeUtil.multiColors(context,cursorColor, darkColor: Colors.white),
+              cursorColor: DarkThemeUtil.multiColors(context, cursorColor, darkColor: Colors.white),
               autofocus: autofocus!,
               autofocus: autofocus!,
               controller: controller,
               controller: controller,
               inputFormatters: inputFormatters,
               inputFormatters: inputFormatters,
@@ -140,9 +140,9 @@ class MyTextField extends StatelessWidget {
                     suffixIcon: showRightIcon == true ? rightWidget : null,
                     suffixIcon: showRightIcon == true ? rightWidget : null,
                     labelText: labelText,
                     labelText: labelText,
                     errorText: errorText,
                     errorText: errorText,
-                    errorStyle: TextStyle(color: hexToColor("#7BABC8"), fontSize: 11.5),
-                    errorBorder: OutlineInputBorder(
-                      borderSide: BorderSide(color: hexToColor("#7BABC8")),
+                    errorStyle: const TextStyle(color: Colors.redAccent, fontSize: 11.5, height: 0.5),
+                    errorBorder: const OutlineInputBorder(
+                      borderSide: BorderSide(color: Colors.redAccent),
                     ),
                     ),
                   ),
                   ),
               onChanged: changeActionType == ClickType.debounce
               onChanged: changeActionType == ClickType.debounce

+ 1 - 1
packages/cs_widgets/lib/shatter/custom_check_box.dart

@@ -103,7 +103,7 @@ class _CustomCheckBoxState extends State<CustomCheckBox> {
     return Row(
     return Row(
       mainAxisSize: MainAxisSize.min,
       mainAxisSize: MainAxisSize.min,
       children: <Widget>[
       children: <Widget>[
-        MyAssetImage(path, width: 20.5, height: 20.5),
+        MyAssetImage(path, width: 15.5, height: 15.5),
         const SizedBox(width: 10),
         const SizedBox(width: 10),
         MyTextView(
         MyTextView(
           text,
           text,