瀏覽代碼

修复 0018189: 【安卓掌超】登录时,账号密码或者验证码登录,输入错误的密码或者账号登录后,账号或者密码框下显示2个水滴型下标,UI上不好看

felix 1 年之前
父節點
當前提交
6396674fac
共有 1 個文件被更改,包括 82 次插入83 次删除
  1. 82 83
      lib/controls/text/fistextfield.dart

+ 82 - 83
lib/controls/text/fistextfield.dart

@@ -68,89 +68,88 @@ class FISTextField extends StatelessWidget {
   Widget build(BuildContext context) {
     FocusNode focusNode = FocusNode();
     return TextField(
-        key: uniqueKey,
-        scrollPadding: EdgeInsets.all(20.0.s),
-        cursorWidth: 2.s,
-        cursorHeight: 25.s,
-        enableInteractiveSelection: false,
-        controller: controller,
-        inputFormatters: inputFormatters,
-        style: textStyle ??
-            Storage.currentTheme.normalTextStyle.copyWith(
-                color: Colors.black,
-                fontSize: Storage.currentTheme.normalTextStyle.fontSize!.s),
-        readOnly: readOnly,
-        onChanged: onChanged,
-        obscureText: obscureText,
-        autofocus: autofocus,
-        focusNode: focusNode,
-        maxLines: maxLines,
-        minLines: minLines,
-        expands: expands,
-        textAlignVertical: textAlignVertical,
-        keyboardType: keyboardType,
-        onSubmitted: onSubmitted,
-        enabled: enabled,
-        decoration: DefaultInputDecoration(
-            placeHolder: placeHolder,
-            errorText: errorText,
-            suffixIcon: suffixIcon,
-            contentPadding:
-                contentPadding ?? EdgeInsets.fromLTRB(12.s, 0, 12.s, 0),
-            fillColor: fillColor,
-            borderColor: borderColor,
-            enabledBorderColor: enabledBorderColor),
-        onTap: onTap ??
-            () async {
-              if (route != Get.currentRoute ||
-                  Storage.platform == Platform.Android) {
-                return;
-              }
-              Offset position = const Offset(0, 0);
-              Size screenSize = const Size(0, 0);
-              double controlHeight = 0;
-              if (uniqueKey is GlobalKey) {
-                final RenderBox renderBox = (uniqueKey as GlobalKey)
-                    .currentContext!
-                    .findRenderObject() as RenderBox;
-                position = renderBox.localToGlobal(Offset.zero);
-                screenSize =
-                    MediaQuery.of((uniqueKey as GlobalKey).currentContext!)
-                        .size;
-                controlHeight = renderBox.size.height;
-              }
-              var positionY = position.dy + controlHeight > screenSize.height
-                  ? screenSize.height
-                  : position.dy + controlHeight;
-              if (positionY < 0) {
-                positionY = 0;
-              }
-              var fiscontrolPositionInfo = FISControlPositionInfo(
-                  isShowSoftwareKeyBoard: true,
-                  screenHeight: screenSize.height,
-                  screenWidth: screenSize.width,
-                  positionX: position.dx,
-                  positionY: positionY);
-              await operateSoftKeyBoard(fiscontrolPositionInfo);
-            },
-        onTapOutside: onTapOutside ??
-            (e) async {
-              if (route != Get.currentRoute) {
-                return;
-              }
-              focusNode.unfocus();
-              if (Storage.platform == Platform.Android) {
-                return;
-              }
-              var fiscontrolPositionInfo = FISControlPositionInfo(
-                  isShowSoftwareKeyBoard: false,
-                  screenHeight: 0,
-                  screenWidth: 0,
-                  positionX: 0,
-                  positionY: 0);
-              await operateSoftKeyBoard(fiscontrolPositionInfo);
-            },
-        obscuringCharacter: "*");
+      key: uniqueKey,
+      scrollPadding: EdgeInsets.all(20.0.s),
+      cursorWidth: 2.s,
+      cursorHeight: 25.s,
+      enableInteractiveSelection: false,
+      controller: controller,
+      inputFormatters: inputFormatters,
+      style: textStyle ??
+          Storage.currentTheme.normalTextStyle.copyWith(
+              color: Colors.black,
+              fontSize: Storage.currentTheme.normalTextStyle.fontSize!.s),
+      readOnly: readOnly,
+      onChanged: onChanged,
+      obscureText: obscureText,
+      autofocus: autofocus,
+      focusNode: focusNode,
+      maxLines: maxLines,
+      minLines: minLines,
+      expands: expands,
+      textAlignVertical: textAlignVertical,
+      keyboardType: keyboardType,
+      onSubmitted: onSubmitted,
+      enabled: enabled,
+      decoration: DefaultInputDecoration(
+          placeHolder: placeHolder,
+          errorText: errorText,
+          suffixIcon: suffixIcon,
+          contentPadding:
+              contentPadding ?? EdgeInsets.fromLTRB(12.s, 0, 12.s, 0),
+          fillColor: fillColor,
+          borderColor: borderColor,
+          enabledBorderColor: enabledBorderColor),
+      onTap: onTap ??
+          () async {
+            if (route != Get.currentRoute ||
+                Storage.platform == Platform.Android) {
+              return;
+            }
+            Offset position = const Offset(0, 0);
+            Size screenSize = const Size(0, 0);
+            double controlHeight = 0;
+            if (uniqueKey is GlobalKey) {
+              final RenderBox renderBox = (uniqueKey as GlobalKey)
+                  .currentContext!
+                  .findRenderObject() as RenderBox;
+              position = renderBox.localToGlobal(Offset.zero);
+              screenSize =
+                  MediaQuery.of((uniqueKey as GlobalKey).currentContext!).size;
+              controlHeight = renderBox.size.height;
+            }
+            var positionY = position.dy + controlHeight > screenSize.height
+                ? screenSize.height
+                : position.dy + controlHeight;
+            if (positionY < 0) {
+              positionY = 0;
+            }
+            var fiscontrolPositionInfo = FISControlPositionInfo(
+                isShowSoftwareKeyBoard: true,
+                screenHeight: screenSize.height,
+                screenWidth: screenSize.width,
+                positionX: position.dx,
+                positionY: positionY);
+            await operateSoftKeyBoard(fiscontrolPositionInfo);
+          },
+      onTapOutside: onTapOutside ??
+          (e) async {
+            if (route != Get.currentRoute) {
+              return;
+            }
+            focusNode.unfocus();
+            if (Storage.platform == Platform.Android) {
+              return;
+            }
+            var fiscontrolPositionInfo = FISControlPositionInfo(
+                isShowSoftwareKeyBoard: false,
+                screenHeight: 0,
+                screenWidth: 0,
+                positionX: 0,
+                positionY: 0);
+            await operateSoftKeyBoard(fiscontrolPositionInfo);
+          },
+    );
   }
 }