响应式网站用什么软件做效果,百度收录批量查询工具,大淘客怎样做网站,wordpress钩子教程TextField组件本身具备多种属性#xff0c;支持很多参数设置来实现不同样式效果。 TextField组件可直接上手使用#xff0c;但默认样式和输入规则并不一定是需求开发中想要的#xff08;实话说默认样式并不好看#xff09;。下面就通过Flutter TextField组件属性介绍来自定…TextField组件本身具备多种属性支持很多参数设置来实现不同样式效果。 TextField组件可直接上手使用但默认样式和输入规则并不一定是需求开发中想要的实话说默认样式并不好看。下面就通过Flutter TextField组件属性介绍来自定义属于自己的输入框吧。
Flutter中文网
Flutter开发
基础功能
obscureText: true表示隐藏输入内容类似密码输入 readOnly: true表示输入框禁止输入 textCapitalization控制输入内容大小写(words 首字母大写、sentences 句子首字母大写、characters 所有字母大写)可能存在兼容性问题会不生效。 minLines maxLines: 最小行数和最大行数设置若只设置最大行数输入框高度就是maxLines的高度否则是minLines的高度。 maxLength: 输入字符限制器。在输入框下方会出现输入字符数量一般也不希望透出计数
switch (theme.platform) {case TargetPlatform.iOS:final CupertinoThemeData cupertinoTheme CupertinoTheme.of(context);forcePressEnabled true;textSelectionControls ?? cupertinoTextSelectionControls;paintCursorAboveText true;cursorOpacityAnimates true;cursorColor ?? selectionTheme.cursorColor ?? cupertinoTheme.primaryColor;selectionColor selectionTheme.selectionColor ?? cupertinoTheme.primaryColor.withOpacity(0.40);cursorRadius ?? const Radius.circular(2.0);cursorOffset Offset(iOSHorizontalOffset / MediaQuery.of(context).devicePixelRatio, 0);autocorrectionTextRectColor selectionColor;break;......case TargetPlatform.android:case TargetPlatform.fuchsia:forcePressEnabled false;textSelectionControls ?? materialTextSelectionControls;paintCursorAboveText false;cursorOpacityAnimates false;cursorColor ?? selectionTheme.cursorColor ?? theme.colorScheme.primary;selectionColor selectionTheme.selectionColor ?? theme.colorScheme.primary.withOpacity(0.40);break;