,该回调没有参数,(){}
this.onSubmitted, //同样是点击键盘完成按钮时触发的回调,该回调有参数,参数即为当前输入框中的值。...(String){}
this.inputFormatters, //对输入文本的校验
this.enabled, //输入框是否可用
this.cursorWidth = 2.0, //光标的宽度...this.cursorRadius, //光标的圆角
this.cursorColor, //光标的颜色
this.keyboardAppearance,
this.scrollPadding...this.enableInteractiveSelection,
this.onTap, //点击输入框时的回调(){}
this.buildCounter,
this.scrollPhysics,
})
TextField最简单的使用方法就是无参数调用...controllerValue),
],
),
);
}
}
这种方法有几个问题需要注意:
用于常用的获取值与赋值的操作
在使用 controller.addListener 的时候,我无法在里面设置