Commit ae703c52c13cb40b1fafda182d8222e48f39ee0e

Authored by 常守达
1 parent 2be22b94

fix(login): 输入框错误提示

@@ -140,10 +140,10 @@ class AddSecurityEmailController extends GetxController { @@ -140,10 +140,10 @@ class AddSecurityEmailController extends GetxController {
140 140
141 Future<void> sendVerificationEmail({bool isChangeEmail = false}) async { 141 Future<void> sendVerificationEmail({bool isChangeEmail = false}) async {
142 hasSubmittedEmail.value = true; 142 hasSubmittedEmail.value = true;
143 - // if (!isEmailValid) {  
144 - // AppToast.show(l10n.invalidEmailFormat);  
145 - // return;  
146 - // } 143 + if (!isEmailValid) {
  144 + // AppToast.show(l10n.invalidEmailFormat);
  145 + return;
  146 + }
147 try { 147 try {
148 await LoadingService.instance.run(() async { 148 await LoadingService.instance.run(() async {
149 final checkRsult = await _userApi.requestEmailCheck( 149 final checkRsult = await _userApi.requestEmailCheck(
@@ -138,39 +138,43 @@ class AddSecurityEmailView extends GetView<AddSecurityEmailController> { @@ -138,39 +138,43 @@ class AddSecurityEmailView extends GetView<AddSecurityEmailController> {
138 }), 138 }),
139 ), 139 ),
140 ), 140 ),
141 - Obx(() {  
142 - if (!c.showError) return const SizedBox(height: 0);  
143 - return Padding(  
144 - padding: const EdgeInsets.only(top: 8, left: 20),  
145 - child: Align(  
146 - alignment: Alignment.centerLeft,  
147 - child: Text(  
148 - l10n.invalidEmailFormat,  
149 - style: TextStyle(  
150 - color: Theme.of(context).colorScheme.error,  
151 - fontSize: 12,  
152 - ),  
153 - ),  
154 - ),  
155 - );  
156 - }),  
157 SizedBox( 141 SizedBox(
158 height: 88, 142 height: 88,
159 - child: Padding(  
160 - padding:  
161 - const EdgeInsets.only(top: 8.0, left: 20, right: 20),  
162 - child: Obx(() => c.emailInput.value.isNotEmpty &&  
163 - controller.isEmailExist.value  
164 - ? Text(  
165 - controller.isEmailExistText,  
166 - textAlign: TextAlign.center,  
167 - style: TextStyle(  
168 - color: context.colors.warning,  
169 - fontSize: 14,  
170 - fontWeight: FontWeight.w400, 143 + child: Column(
  144 + children: [
  145 + Obx(() {
  146 + if (!c.showError) return const SizedBox(height: 0);
  147 + return Padding(
  148 + padding: const EdgeInsets.only(top: 8, left: 20),
  149 + child: Align(
  150 + alignment: Alignment.centerLeft,
  151 + child: Text(
  152 + l10n.invalidEmailFormat,
  153 + style: TextStyle(
  154 + color: context.colors.warning,
  155 + fontSize: 12,
  156 + ),
171 ), 157 ),
172 - )  
173 - : SizedBox.shrink()), 158 + ),
  159 + );
  160 + }),
  161 + Padding(
  162 + padding: const EdgeInsets.only(
  163 + top: 8.0, left: 20, right: 20),
  164 + child: Obx(() => c.emailInput.value.isNotEmpty &&
  165 + controller.isEmailExist.value
  166 + ? Text(
  167 + controller.isEmailExistText,
  168 + textAlign: TextAlign.center,
  169 + style: TextStyle(
  170 + color: context.colors.warning,
  171 + fontSize: 14,
  172 + fontWeight: FontWeight.w400,
  173 + ),
  174 + )
  175 + : SizedBox.shrink()),
  176 + ),
  177 + ],
174 ), 178 ),
175 ), 179 ),
176 SizedBox( 180 SizedBox(