put own reaction to the right
This commit is contained in:
@@ -43,14 +43,16 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return GestureDetector(
|
||||||
children: [
|
|
||||||
Positioned.fill(
|
|
||||||
child: GestureDetector(
|
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.translucent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.only(top: 160),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(
|
filter: ImageFilter.blur(
|
||||||
sigmaX: 10,
|
sigmaX: 10,
|
||||||
@@ -61,7 +63,6 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -85,9 +86,6 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
text: message.text.length > 200
|
text: message.text.length > 200
|
||||||
? '${message.text.substring(0, 200)}...'
|
? '${message.text.substring(0, 200)}...'
|
||||||
: message.text,
|
: message.text,
|
||||||
attachments: message.attachments.length > 1
|
|
||||||
? [message.attachments[0]]
|
|
||||||
: message.attachments,
|
|
||||||
),
|
),
|
||||||
messageTheme: messageTheme,
|
messageTheme: messageTheme,
|
||||||
showReactions: false,
|
showReactions: false,
|
||||||
@@ -101,8 +99,7 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
Flexible(
|
Padding(
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 48.0,
|
horizontal: 48.0,
|
||||||
),
|
),
|
||||||
@@ -111,7 +108,6 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: ListTile.divideTiles(
|
children: ListTile.divideTiles(
|
||||||
@@ -129,13 +125,13 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
).toList(),
|
).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,14 +34,16 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return GestureDetector(
|
||||||
children: [
|
|
||||||
Positioned.fill(
|
|
||||||
child: GestureDetector(
|
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.translucent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.only(top: 160),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(
|
filter: ImageFilter.blur(
|
||||||
sigmaX: 10,
|
sigmaX: 10,
|
||||||
@@ -52,7 +54,6 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -76,9 +77,6 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
text: message.text.length > 200
|
text: message.text.length > 200
|
||||||
? '${message.text.substring(0, 200)}...'
|
? '${message.text.substring(0, 200)}...'
|
||||||
: message.text,
|
: message.text,
|
||||||
attachments: message.attachments.length > 1
|
|
||||||
? [message.attachments[0]]
|
|
||||||
: message.attachments,
|
|
||||||
),
|
),
|
||||||
messageTheme: messageTheme,
|
messageTheme: messageTheme,
|
||||||
showReactions: false,
|
showReactions: false,
|
||||||
@@ -93,16 +91,13 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
height: 16,
|
height: 16,
|
||||||
),
|
),
|
||||||
if (message.latestReactions?.isNotEmpty == true)
|
if (message.latestReactions?.isNotEmpty == true)
|
||||||
Flexible(
|
_buildReactionCard(context),
|
||||||
child: Container(
|
|
||||||
constraints: BoxConstraints.loose(Size.fromHeight(400)),
|
|
||||||
child: _buildReactionCard(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -392,6 +392,8 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
reactionsMap[element.type] = element;
|
reactionsMap[element.type] = element;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
final reactionsList = reactionsMap.values.toList()
|
||||||
|
..sort((a, b) => a.user.id == ownId ? 1 : -1);
|
||||||
|
|
||||||
return AnimatedSwitcher(
|
return AnimatedSwitcher(
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
@@ -406,7 +408,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
flipTail: widget.reverse,
|
flipTail: widget.reverse,
|
||||||
backgroundColor: widget.messageTheme.reactionsBackgroundColor,
|
backgroundColor: widget.messageTheme.reactionsBackgroundColor,
|
||||||
borderColor: widget.messageTheme.reactionsBorderColor,
|
borderColor: widget.messageTheme.reactionsBorderColor,
|
||||||
reactions: reactionsMap.values.toList(),
|
reactions: reactionsList,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: SizedBox(),
|
: SizedBox(),
|
||||||
|
|||||||
Reference in New Issue
Block a user