Skip to content

Commit b330ca3

Browse files
committed
msg_list: Use scale down with opacity animation for mark-as-read
Fixes: zulip#613
1 parent c023ca1 commit b330ca3

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

lib/widgets/message_list.dart

+15-9
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,21 @@ class _AnimatedUnread extends StatelessWidget {
631631

632632
@override
633633
Widget build(BuildContext context) {
634-
return AnimatedOpacity(
635-
opacity: isRead ? 0 : 1,
636-
// Web uses 2s and 0.3s durations, and a CSS ease-out curve.
637-
// See zulip:web/styles/message_row.css .
638-
// As of now we wait for the ack from the server
639-
// so we're going with 0.1s as soon as the ack is received.
640-
duration: Duration(milliseconds: isRead ? 100 : 300),
641-
curve: Curves.easeOut,
642-
child: child);
634+
final duration = Duration(milliseconds: isRead ? 100 : 300);
635+
final visibility = isRead ? 0.0 : 1.0;
636+
return AnimatedScale(
637+
scale: visibility,
638+
duration: duration,
639+
child: AnimatedOpacity(
640+
opacity: visibility,
641+
// Web uses 2s and 0.3s durations, and a CSS ease-out curve.
642+
// See zulip:web/styles/message_row.css .
643+
// As of now we wait for the ack from the server
644+
// so we're going with 0.1s as soon as the ack is received.
645+
duration: duration,
646+
curve: Curves.easeOut,
647+
child: child),
648+
);
643649
}
644650
}
645651

0 commit comments

Comments
 (0)