fix: Fixed textfield not expanding
This commit is contained in:
@@ -433,83 +433,80 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
_buildAttachments(),
|
_buildAttachments(),
|
||||||
LimitedBox(
|
LimitedBox(
|
||||||
maxHeight: widget.maxHeight,
|
maxHeight: widget.maxHeight,
|
||||||
child: SizedBox(
|
child: TextField(
|
||||||
height: 40,
|
key: Key('messageInputText'),
|
||||||
child: TextField(
|
enabled: _inputEnabled,
|
||||||
key: Key('messageInputText'),
|
minLines: null,
|
||||||
enabled: _inputEnabled,
|
maxLines: null,
|
||||||
minLines: null,
|
onSubmitted: (_) => sendMessage(),
|
||||||
maxLines: null,
|
keyboardType: widget.keyboardType,
|
||||||
onSubmitted: (_) => sendMessage(),
|
controller: textEditingController,
|
||||||
keyboardType: widget.keyboardType,
|
focusNode: _focusNode,
|
||||||
controller: textEditingController,
|
style: theme.textTheme.body,
|
||||||
focusNode: _focusNode,
|
autofocus: false,
|
||||||
style: theme.textTheme.body,
|
textAlignVertical: TextAlignVertical.center,
|
||||||
autofocus: false,
|
decoration: InputDecoration(
|
||||||
textAlignVertical: TextAlignVertical.center,
|
isDense: true,
|
||||||
decoration: InputDecoration(
|
hintText: _getHint(),
|
||||||
isDense: true,
|
hintStyle: theme.textTheme.body.copyWith(
|
||||||
hintText: _getHint(),
|
color: theme.colorTheme.grey,
|
||||||
hintStyle: theme.textTheme.body.copyWith(
|
|
||||||
color: theme.colorTheme.grey,
|
|
||||||
),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: Colors.transparent)),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: Colors.transparent)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: Colors.transparent)),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: Colors.transparent)),
|
|
||||||
disabledBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: Colors.transparent)),
|
|
||||||
contentPadding: const EdgeInsets.fromLTRB(16, 12, 13, 11),
|
|
||||||
prefixIcon: _commandEnabled
|
|
||||||
? Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
color: theme.colorTheme.accentBlue,
|
|
||||||
),
|
|
||||||
height: 24,
|
|
||||||
margin: const EdgeInsets.all(8.0),
|
|
||||||
padding: const EdgeInsets.only(right: 8, left: 4),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
StreamSvgIcon.lightning(
|
|
||||||
color: Colors.white,
|
|
||||||
size: 16.0,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
_chosenCommand?.name?.toUpperCase() ?? '',
|
|
||||||
style: StreamChatTheme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.footnoteBold
|
|
||||||
.copyWith(
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
suffixIcon: _commandEnabled
|
|
||||||
? IconButton(
|
|
||||||
icon: StreamSvgIcon.close_small(),
|
|
||||||
splashRadius: 24,
|
|
||||||
padding: const EdgeInsets.all(0),
|
|
||||||
constraints: BoxConstraints.tightFor(
|
|
||||||
height: 24,
|
|
||||||
width: 24,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() => _commandEnabled = false);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
),
|
),
|
||||||
textCapitalization: TextCapitalization.sentences,
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.transparent)),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.transparent)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.transparent)),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.transparent)),
|
||||||
|
disabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.transparent)),
|
||||||
|
contentPadding: const EdgeInsets.fromLTRB(16, 12, 13, 11),
|
||||||
|
prefixIcon: _commandEnabled
|
||||||
|
? Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color: theme.colorTheme.accentBlue,
|
||||||
|
),
|
||||||
|
height: 24,
|
||||||
|
margin: const EdgeInsets.all(8.0),
|
||||||
|
padding: const EdgeInsets.only(right: 8, left: 4),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
StreamSvgIcon.lightning(
|
||||||
|
color: Colors.white,
|
||||||
|
size: 16.0,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
_chosenCommand?.name?.toUpperCase() ?? '',
|
||||||
|
style: StreamChatTheme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.footnoteBold
|
||||||
|
.copyWith(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
suffixIcon: _commandEnabled
|
||||||
|
? IconButton(
|
||||||
|
icon: StreamSvgIcon.close_small(),
|
||||||
|
splashRadius: 24,
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
constraints: BoxConstraints.tightFor(
|
||||||
|
height: 24,
|
||||||
|
width: 24,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() => _commandEnabled = false);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
|
textCapitalization: TextCapitalization.sentences,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user