直接上代码 :
TextEditingController _contentController = new TextEditingController();
FocusNode _contentFocusNode = FocusNode();
Container(
padding: EdgeInsets.fromLTRB(0.00, 5.00, 0.00, 5.00),
child: TextField(
focusNode: _contentFocusNode,
controller: _contentController,
style: TextStyle(fontSize: 9.00, color: Colors.black),
autocorrect: false,
maxLines: 2,
decoration: new InputDecoration(
labelText: '内容',
border: new OutlineInputBorder(
borderRadius: new BorderRadius.circular(3.0))),
onChanged: (val) {
if (val.length > 300) {
_newContent = val.substring(0, 300);
_contentController.text = _newContent;
} else {