put own reaction to the right
This commit is contained in:
@@ -43,75 +43,71 @@ class MessageActionsModal extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return GestureDetector(
|
||||||
children: [
|
behavior: HitTestBehavior.translucent,
|
||||||
Positioned.fill(
|
onTap: () {
|
||||||
child: GestureDetector(
|
Navigator.pop(context);
|
||||||
behavior: HitTestBehavior.translucent,
|
},
|
||||||
onTap: () {
|
child: SingleChildScrollView(
|
||||||
Navigator.pop(context);
|
padding: const EdgeInsets.only(top: 160),
|
||||||
},
|
child: Stack(
|
||||||
child: BackdropFilter(
|
children: [
|
||||||
filter: ImageFilter.blur(
|
Positioned.fill(
|
||||||
sigmaX: 10,
|
child: BackdropFilter(
|
||||||
sigmaY: 10,
|
filter: ImageFilter.blur(
|
||||||
),
|
sigmaX: 10,
|
||||||
child: Container(
|
sigmaY: 10,
|
||||||
color: Colors.transparent,
|
),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: <Widget>[
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
if (showReactions &&
|
||||||
children: <Widget>[
|
(message.status == MessageSendingStatus.SENT ||
|
||||||
if (showReactions &&
|
message.status == null))
|
||||||
(message.status == MessageSendingStatus.SENT ||
|
Center(
|
||||||
message.status == null))
|
child: ReactionPicker(
|
||||||
Center(
|
message: message,
|
||||||
child: ReactionPicker(
|
messageTheme: messageTheme,
|
||||||
message: message,
|
),
|
||||||
messageTheme: messageTheme,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IgnorePointer(
|
|
||||||
child: MessageWidget(
|
|
||||||
key: Key('MessageWidget'),
|
|
||||||
reverse: reverse,
|
|
||||||
message: message.copyWith(
|
|
||||||
text: message.text.length > 200
|
|
||||||
? '${message.text.substring(0, 200)}...'
|
|
||||||
: message.text,
|
|
||||||
attachments: message.attachments.length > 1
|
|
||||||
? [message.attachments[0]]
|
|
||||||
: message.attachments,
|
|
||||||
),
|
|
||||||
messageTheme: messageTheme,
|
|
||||||
showReactions: false,
|
|
||||||
showUsername: false,
|
|
||||||
showReplyIndicator: false,
|
|
||||||
showTimestamp: false,
|
|
||||||
showSendingIndicator: DisplayWidget.gone,
|
|
||||||
shape: messageShape,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 48.0,
|
|
||||||
),
|
|
||||||
child: Material(
|
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(16),
|
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
IgnorePointer(
|
||||||
|
child: MessageWidget(
|
||||||
|
key: Key('MessageWidget'),
|
||||||
|
reverse: reverse,
|
||||||
|
message: message.copyWith(
|
||||||
|
text: message.text.length > 200
|
||||||
|
? '${message.text.substring(0, 200)}...'
|
||||||
|
: message.text,
|
||||||
|
),
|
||||||
|
messageTheme: messageTheme,
|
||||||
|
showReactions: false,
|
||||||
|
showUsername: false,
|
||||||
|
showReplyIndicator: false,
|
||||||
|
showTimestamp: false,
|
||||||
|
showSendingIndicator: DisplayWidget.gone,
|
||||||
|
shape: messageShape,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 48.0,
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
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,75 +34,70 @@ class MessageReactionsModal extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return GestureDetector(
|
||||||
children: [
|
behavior: HitTestBehavior.translucent,
|
||||||
Positioned.fill(
|
onTap: () {
|
||||||
child: GestureDetector(
|
Navigator.pop(context);
|
||||||
behavior: HitTestBehavior.translucent,
|
},
|
||||||
onTap: () {
|
child: SingleChildScrollView(
|
||||||
Navigator.pop(context);
|
padding: const EdgeInsets.only(top: 160),
|
||||||
},
|
child: Stack(
|
||||||
child: BackdropFilter(
|
children: [
|
||||||
filter: ImageFilter.blur(
|
Positioned.fill(
|
||||||
sigmaX: 10,
|
child: BackdropFilter(
|
||||||
sigmaY: 10,
|
filter: ImageFilter.blur(
|
||||||
),
|
sigmaX: 10,
|
||||||
child: Container(
|
sigmaY: 10,
|
||||||
color: Colors.transparent,
|
),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
Padding(
|
child: Column(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: <Widget>[
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
if (showReactions &&
|
||||||
children: <Widget>[
|
(message.status == MessageSendingStatus.SENT ||
|
||||||
if (showReactions &&
|
message.status == null))
|
||||||
(message.status == MessageSendingStatus.SENT ||
|
Center(
|
||||||
message.status == null))
|
child: ReactionPicker(
|
||||||
Center(
|
message: message,
|
||||||
child: ReactionPicker(
|
messageTheme: messageTheme,
|
||||||
message: message,
|
),
|
||||||
messageTheme: messageTheme,
|
),
|
||||||
|
IgnorePointer(
|
||||||
|
child: MessageWidget(
|
||||||
|
key: Key('MessageWidget'),
|
||||||
|
reverse: reverse,
|
||||||
|
message: message.copyWith(
|
||||||
|
text: message.text.length > 200
|
||||||
|
? '${message.text.substring(0, 200)}...'
|
||||||
|
: message.text,
|
||||||
|
),
|
||||||
|
messageTheme: messageTheme,
|
||||||
|
showReactions: false,
|
||||||
|
showUsername: false,
|
||||||
|
showReplyIndicator: false,
|
||||||
|
showTimestamp: false,
|
||||||
|
showSendingIndicator: DisplayWidget.gone,
|
||||||
|
shape: messageShape,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(
|
||||||
IgnorePointer(
|
height: 16,
|
||||||
child: MessageWidget(
|
|
||||||
key: Key('MessageWidget'),
|
|
||||||
reverse: reverse,
|
|
||||||
message: message.copyWith(
|
|
||||||
text: message.text.length > 200
|
|
||||||
? '${message.text.substring(0, 200)}...'
|
|
||||||
: message.text,
|
|
||||||
attachments: message.attachments.length > 1
|
|
||||||
? [message.attachments[0]]
|
|
||||||
: message.attachments,
|
|
||||||
),
|
),
|
||||||
messageTheme: messageTheme,
|
if (message.latestReactions?.isNotEmpty == true)
|
||||||
showReactions: false,
|
_buildReactionCard(context),
|
||||||
showUsername: false,
|
],
|
||||||
showReplyIndicator: false,
|
|
||||||
showTimestamp: false,
|
|
||||||
showSendingIndicator: DisplayWidget.gone,
|
|
||||||
shape: messageShape,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
),
|
||||||
height: 16,
|
],
|
||||||
),
|
|
||||||
if (message.latestReactions?.isNotEmpty == true)
|
|
||||||
Flexible(
|
|
||||||
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