Flutter 输入框组件TextField相当于Android中的EditText
const TextField({
Key key,
this.controller, // 控制正在编辑文本
this.focusNode, // 获取键盘焦点
this.decoration = const InputDecoration(), // 边框装饰
TextInputType keyboardType, // 键盘类型
this.textInputAction, // 键盘的操作按钮类型
this.textCapitalization = TextCapitalization.none, // 配置大小写键盘
this.style, // 输入文本样式
this.strutStyle, //用于垂直布局的支柱样式。
this.textAlign = TextAlign.start, // 对齐方式
this.textAlignVertical, // 文本垂直对齐
this.textDirection, // 文本方向
this.readOnly = false, // 是否只读
ToolbarOptions toolbarOptions, // 工具栏选项的配置
this.showCursor, // 是否显示光标
this.autofocus = false, // 是否自动获取焦点
this.obscureText = false, // 是否隐藏内容,例如密码
this.autocorrect = true, //是否自动校正
this.enableSuggestions = true, // 是否在用户键入时显示输入建议
this.maxLines = 1, // 最大行数
this.minLines, // 当内容跨越较少行时要占用的最小行数。
this.expands = false, //是否将调整此小部件的高度以填充其父级。
this.maxLength, // 允许输入的最大长度
this.maxLengthEnforced = true, // 是否允许超过输入最大长度
this.onChanged, // 文本内容变更时回调
this.onEditingComplete, // 提交内容时回调
this.onSubmitted, //当用户指示已完成编辑字段中的文本时调用
this.inputFormatters, // 验证及格式
this.enabled, // 是否不可点击
this.cursorWidth = 2.0, // 光标宽度
this.cursorRadius, // 光标圆角弧度
this.cursorColor, // 光标颜色
this.keyboardAppearance, // 键盘亮度
this.scrollPadding = const EdgeInsets.all(20.0),// 滚动到视图中时,填充边距
this.dragStartBehavior = DragStartBehavior.start, //确定拖动开始行为的处理方式
this.enableInteractiveSelection = true, //长按是否展示【剪切/复制/粘贴菜单LengthLimitingTextInputFormatter】
this.onTap, // 点击时回调
this.buildCounter, //生成自定义InputDecorator.counter组件的回调。
this.scrollController, // 垂直滚动输入时使用的滚动控制器。
})