Here is a widget that creates a text input in a scrolling area. I want the text widget to grow from minHeight to maxHeight, but it defaults to maxHeight.
How can I construct this to grow from minHeight to maxHeight, even though the text input has no height?
Here is my current code:
return new ConstrainedBox(
constraints: new BoxConstraints(
minHeight: 25.0,
maxHeight: 60.0,
),
child: new ListView(
scrollDirection: Axis.vertical,
reverse: true,
children: <Widget>[
new Container(
decoration: new BoxDecoration(
color: Colors.grey,
),
padding: const EdgeInsets.all(7.0),
// here's the actual text box
child: new TextField(
keyboardType: TextInputType.multiline,
maxLines: null, //grow automatically
focusNode: mrFocus,
controller: _textController,
onSubmitted: currentIsComposing ? _handleSubmitted : null,
decoration: new InputDecoration.collapsed(
hintText: ChqStrings.of(context).sendAMessage(),
),
),
// ends the actual text box
),
],
),
);