feat: Added animations for giphy and mentions
This commit is contained in:
+38
-10
@@ -536,6 +536,14 @@ class MessageInputState extends State<MessageInput> {
|
||||
bottom: size.height + MediaQuery.of(context).viewInsets.bottom,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0.0, end: 1.0),
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutExpo,
|
||||
builder: (context, val, wid) {
|
||||
return Transform.scale(
|
||||
alignment: Alignment.center,
|
||||
scale: val,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Card(
|
||||
@@ -556,15 +564,17 @@ class MessageInputState extends State<MessageInput> {
|
||||
children: [
|
||||
if (commands.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0, top: 8.0),
|
||||
padding:
|
||||
const EdgeInsets.only(left: 8.0, top: 8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0),
|
||||
child: Icon(
|
||||
StreamIcons.lightning,
|
||||
color: StreamChatTheme.of(context).accentColor,
|
||||
color: StreamChatTheme.of(context)
|
||||
.accentColor,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -579,11 +589,14 @@ class MessageInputState extends State<MessageInput> {
|
||||
...commands
|
||||
.map(
|
||||
(c) => ListTile(
|
||||
leading: c.name == 'giphy' ? _buildGiphyIcon() : null,
|
||||
leading: c.name == 'giphy'
|
||||
? _buildGiphyIcon()
|
||||
: null,
|
||||
title: Text.rich(
|
||||
TextSpan(
|
||||
text: '${c.name.capitalize()}',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: ' /${c.name} ${c.args}',
|
||||
@@ -617,6 +630,8 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -925,6 +940,13 @@ class MessageInputState extends State<MessageInput> {
|
||||
bottom: size.height + MediaQuery.of(context).viewInsets.bottom,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0.0, end: 1.0),
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutExpo,
|
||||
builder: (context, val, wid) {
|
||||
return Transform.scale(
|
||||
scale: val,
|
||||
child: Card(
|
||||
margin: EdgeInsets.all(8.0),
|
||||
elevation: 2.0,
|
||||
@@ -958,12 +980,14 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
title: Text(
|
||||
'${m.user.name}',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
subtitle: Text('@${m.userId}'),
|
||||
trailing: Icon(
|
||||
StreamIcons.at_mention,
|
||||
color: StreamChatTheme.of(context).accentColor,
|
||||
color: StreamChatTheme.of(context)
|
||||
.accentColor,
|
||||
),
|
||||
onTap: () {
|
||||
_mentionedUsers.add(m.user);
|
||||
@@ -971,9 +995,11 @@ class MessageInputState extends State<MessageInput> {
|
||||
splits[splits.length - 1] = m.user.name;
|
||||
final rejoin = splits.join('@');
|
||||
|
||||
textEditingController.value = TextEditingValue(
|
||||
textEditingController.value =
|
||||
TextEditingValue(
|
||||
text: rejoin +
|
||||
textEditingController.text.substring(
|
||||
textEditingController.text
|
||||
.substring(
|
||||
textEditingController
|
||||
.selection.start),
|
||||
selection: TextSelection.collapsed(
|
||||
@@ -991,6 +1017,8 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user