feat: wip message input
This commit is contained in:
+45
-32
@@ -165,6 +165,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
bool _inputEnabled = true;
|
bool _inputEnabled = true;
|
||||||
bool _messageIsPresent = false;
|
bool _messageIsPresent = false;
|
||||||
bool _typingStarted = false;
|
bool _typingStarted = false;
|
||||||
|
bool _giphyEnabled = false;
|
||||||
OverlayEntry _commandsOverlay, _mentionsOverlay;
|
OverlayEntry _commandsOverlay, _mentionsOverlay;
|
||||||
|
|
||||||
/// The editing controller passed to the input TextField
|
/// The editing controller passed to the input TextField
|
||||||
@@ -205,6 +206,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (!widget.disableAttachments) _buildAttachmentButton(),
|
if (!widget.disableAttachments) _buildAttachmentButton(),
|
||||||
|
_buildGiphyButton(),
|
||||||
if (widget.actionsLocation == ActionsLocation.left)
|
if (widget.actionsLocation == ActionsLocation.left)
|
||||||
...widget.actions ?? [],
|
...widget.actions ?? [],
|
||||||
_buildTextInput(context),
|
_buildTextInput(context),
|
||||||
@@ -614,6 +616,31 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildGiphyButton() {
|
||||||
|
return Center(
|
||||||
|
child: Material(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(32),
|
||||||
|
),
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_giphyEnabled = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: Transform.rotate(
|
||||||
|
child: Icon(
|
||||||
|
StreamIcons.lightning,
|
||||||
|
),
|
||||||
|
angle: 0.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildAttachmentButton() {
|
Widget _buildAttachmentButton() {
|
||||||
return Center(
|
return Center(
|
||||||
child: Material(
|
child: Material(
|
||||||
@@ -856,22 +883,15 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Material(
|
child: IconButton(
|
||||||
clipBehavior: Clip.hardEdge,
|
key: Key('sendButtonIdle'),
|
||||||
shape: RoundedRectangleBorder(
|
onPressed: () {
|
||||||
borderRadius: BorderRadius.circular(32),
|
sendMessage();
|
||||||
),
|
},
|
||||||
color: Colors.grey,
|
icon: Icon(
|
||||||
child: IconButton(
|
StreamIcons.send_message,
|
||||||
key: Key('sendButton'),
|
color: Colors.grey,
|
||||||
onPressed: () {
|
size: 16.0,
|
||||||
sendMessage();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.arrow_forward,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 16.0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -886,22 +906,15 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Material(
|
child: IconButton(
|
||||||
clipBehavior: Clip.hardEdge,
|
key: Key('sendButton'),
|
||||||
shape: RoundedRectangleBorder(
|
onPressed: () {
|
||||||
borderRadius: BorderRadius.circular(32),
|
sendMessage();
|
||||||
),
|
},
|
||||||
color: StreamChatTheme.of(context).accentColor,
|
icon: Icon(
|
||||||
child: IconButton(
|
StreamIcons.send_message,
|
||||||
key: Key('sendButton'),
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
onPressed: () {
|
size: 16.0,
|
||||||
sendMessage();
|
|
||||||
},
|
|
||||||
icon: Icon(
|
|
||||||
Icons.arrow_upward,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 16.0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user