【发布时间】:2021-03-28 08:53:09
【问题描述】:
如果用户按下我的登录按钮后该字段为空,我将尝试在 Cupertino TextField 下方显示错误文本。似乎没有明确的方法可以在任何 CupertinoTextfield 参数中像在 android 上那样在文本字段下方显示错误标签。
我如何做到这一点?
这是我的代码
CupertinoTextField(
key: widget.key,
keyboardType: widget.textInputType,
placeholder: widget.errorText ?? widget.hint,
style: widget.style,
onChanged: widget.onChanged,
enabled: widget.enabled,
controller: widget.textEditingController,
focusNode: _focusNode,
obscureText: widget.obscureText,
enableSuggestions: widget.enableSuggestions,
autocorrect: widget.autocorrect,
clearButtonMode: OverlayVisibilityMode.editing,
padding: widget.iosPaddings != null
? widget.iosPaddings!
: const EdgeInsets.all(4),
);
【问题讨论】:
-
这个错误会是 iOS UI 和设计系统的典型部分吗?我不熟悉 iOS 应用程序上的表单,但有可能它不存在,因为 iOS 上的设计系统期望错误以不同的方式显示。
标签: flutter