I use TextFormField Widget, and I set the maxlines parameter to 5. But I was able to keep typing. I want to limit input when maxline is reached. what should I do?
TextFormField(
controller: _contextController,
cursorColor: Colors.white,
textAlign: TextAlign.center,
focusNode: _contextFocus,
keyboardType: TextInputType.multiline,
minLines: 1,
maxLines: 5,
inputFormatters: [F],
decoration: InputDecoration(
fillColor: Color(0xBD000000),
filled: true,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
border: InputBorder.none,
errorBorder: InputBorder.none,
contentPadding: EdgeInsets.all(20),
hintText: _contextHint,
hintStyle: TextStyle(color: Colors.white)),
),