hide overlay on delete message
This commit is contained in:
@@ -61,6 +61,8 @@ class MessageActionsModal extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
bool _showActions = true;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _showMessageOptionsModal();
|
||||
@@ -87,13 +89,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
? 1
|
||||
: (roughSentenceSize == 0 ? 1 : (roughSentenceSize / roughMaxSize));
|
||||
|
||||
return TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0.0, end: 1.0),
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutBack,
|
||||
builder: (context, val, snapshot) {
|
||||
final hasFileAttachment =
|
||||
widget.message.attachments?.any((it) => it.type == 'file') == true;
|
||||
|
||||
return GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () => Navigator.maybePop(context),
|
||||
@@ -110,7 +108,13 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Transform.scale(
|
||||
if (_showActions)
|
||||
TweenAnimationBuilder<double>(
|
||||
tween: Tween(begin: 0.0, end: 1.0),
|
||||
duration: Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOutBack,
|
||||
builder: (context, val, snapshot) {
|
||||
return Transform.scale(
|
||||
scale: val,
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
@@ -164,8 +168,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
padding: const EdgeInsets.all(0),
|
||||
textPadding: EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
horizontal:
|
||||
widget.message.text.isOnlyEmoji ? 0 : 16.0,
|
||||
horizontal: widget.message.text.isOnlyEmoji
|
||||
? 0
|
||||
: 16.0,
|
||||
),
|
||||
showReactionPickerIndicator:
|
||||
widget.showReactions &&
|
||||
@@ -236,12 +241,12 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showFlagDialog() async {
|
||||
@@ -273,6 +278,9 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
}
|
||||
|
||||
void _showDeleteDialog() async {
|
||||
setState(() {
|
||||
_showActions = false;
|
||||
});
|
||||
var answer = await showConfirmationDialog(context,
|
||||
title: 'Delete message',
|
||||
icon: StreamSvgIcon.flag(
|
||||
@@ -293,6 +301,10 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
|
||||
} catch (err) {
|
||||
_showErrorAlert();
|
||||
}
|
||||
} else {
|
||||
setState(() {
|
||||
_showActions = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user