fix: attachments ui
This commit is contained in:
+24
-16
@@ -197,8 +197,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if(!_commandEnabled)
|
if (!_commandEnabled) _buildExpandActionsButton(),
|
||||||
_buildExpandActionsButton(),
|
|
||||||
if (widget.actionsLocation == ActionsLocation.left)
|
if (widget.actionsLocation == ActionsLocation.left)
|
||||||
...widget.actions ?? [],
|
...widget.actions ?? [],
|
||||||
_buildTextInput(context),
|
_buildTextInput(context),
|
||||||
@@ -224,16 +223,18 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
|
|
||||||
Widget _buildExpandActionsButton() {
|
Widget _buildExpandActionsButton() {
|
||||||
return AnimatedCrossFade(
|
return AnimatedCrossFade(
|
||||||
crossFadeState: _actionsShrunk
|
crossFadeState:
|
||||||
? CrossFadeState.showFirst
|
_actionsShrunk ? CrossFadeState.showFirst : CrossFadeState.showSecond,
|
||||||
: CrossFadeState.showSecond,
|
|
||||||
firstChild: IconButton(
|
firstChild: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_actionsShrunk = false;
|
_actionsShrunk = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: Icon(StreamIcons.circle_left, color: StreamChatTheme.of(context).accentColor,),
|
icon: Icon(
|
||||||
|
StreamIcons.circle_left,
|
||||||
|
color: StreamChatTheme.of(context).accentColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
secondChild: Row(
|
secondChild: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
@@ -254,14 +255,13 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
maxHeight: widget.maxHeight,
|
maxHeight: widget.maxHeight,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: _typingStarted
|
color: _typingStarted
|
||||||
? Colors.transparent
|
? Colors.transparent
|
||||||
: Theme.of(context).brightness == Brightness.dark
|
: Theme.of(context).brightness == Brightness.dark
|
||||||
? Colors.white.withOpacity(.2)
|
? Colors.white.withOpacity(.2)
|
||||||
: Colors.black.withOpacity(.2)),
|
: Colors.black.withOpacity(.2)),
|
||||||
)
|
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -299,7 +299,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
if (textEditingController.selection.isCollapsed &&
|
if (textEditingController.selection.isCollapsed &&
|
||||||
(s[textEditingController.selection.start - 1] == '@' ||
|
(s[textEditingController.selection.start - 1] == '@' ||
|
||||||
textEditingController.text
|
textEditingController.text
|
||||||
.substring(0, textEditingController.selection.start)
|
.substring(
|
||||||
|
0, textEditingController.selection.start)
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.last
|
.last
|
||||||
.contains('@'))) {
|
.contains('@'))) {
|
||||||
@@ -326,9 +327,11 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
contentPadding: EdgeInsets.all(8),
|
contentPadding: EdgeInsets.all(8),
|
||||||
prefixIcon: _commandEnabled
|
prefixIcon: _commandEnabled
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Chip(
|
child: Chip(
|
||||||
backgroundColor: StreamChatTheme.of(context).accentColor,
|
backgroundColor:
|
||||||
|
StreamChatTheme.of(context).accentColor,
|
||||||
label: Text(
|
label: Text(
|
||||||
_chosenCommand?.name ?? "",
|
_chosenCommand?.name ?? "",
|
||||||
style: TextStyle(color: Colors.white),
|
style: TextStyle(color: Colors.white),
|
||||||
@@ -429,8 +432,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
// ),
|
// ),
|
||||||
// ],
|
// ],
|
||||||
color: StreamChatTheme.of(context).primaryColor,
|
color: StreamChatTheme.of(context).primaryColor,
|
||||||
borderRadius: BorderRadius.circular(8.0)
|
borderRadius: BorderRadius.circular(8.0)),
|
||||||
),
|
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
@@ -441,7 +443,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: Icon(StreamIcons.lightning, color: StreamChatTheme.of(context).accentColor),
|
child: Icon(StreamIcons.lightning,
|
||||||
|
color: StreamChatTheme.of(context).accentColor),
|
||||||
),
|
),
|
||||||
Text('Instant Commands')
|
Text('Instant Commands')
|
||||||
],
|
],
|
||||||
@@ -465,8 +468,13 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
trailing: CircleAvatar(
|
trailing: CircleAvatar(
|
||||||
backgroundColor: StreamChatTheme.of(context).accentColor,
|
backgroundColor:
|
||||||
child: Icon(StreamIcons.lightning, color: Colors.white, size: 12.5,),
|
StreamChatTheme.of(context).accentColor,
|
||||||
|
child: Icon(
|
||||||
|
StreamIcons.lightning,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 12.5,
|
||||||
|
),
|
||||||
maxRadius: 15,
|
maxRadius: 15,
|
||||||
),
|
),
|
||||||
//subtitle: Text(c.description),
|
//subtitle: Text(c.description),
|
||||||
|
|||||||
Reference in New Issue
Block a user