File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed
Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -505,10 +505,9 @@ class _MarkAsReadWidgetState extends State<MarkAsReadWidget> {
505505
506506 return IgnorePointer (
507507 ignoring: areMessagesRead,
508- child: AnimatedOpacity (
509- opacity: areMessagesRead ? 0 : _loading ? 0.5 : 1 ,
510- duration: Duration (milliseconds: areMessagesRead ? 2000 : 300 ),
511- curve: Curves .easeOut,
508+ child: MarkAsReadAnimation (
509+ loading: _loading,
510+ hidden: areMessagesRead,
512511 child: SizedBox (width: double .infinity,
513512 // Design referenced from:
514513 // https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?type=design&node-id=132-9684&mode=design&t=jJwHzloKJ0TMOG4M-0
@@ -544,6 +543,28 @@ class _MarkAsReadWidgetState extends State<MarkAsReadWidget> {
544543 }
545544}
546545
546+ class MarkAsReadAnimation extends StatelessWidget {
547+ final bool loading;
548+ final bool hidden;
549+ final Widget child;
550+
551+ const MarkAsReadAnimation ({
552+ super .key,
553+ required this .loading,
554+ required this .hidden,
555+ required this .child
556+ });
557+
558+ @override
559+ Widget build (BuildContext context) {
560+ return AnimatedOpacity (
561+ opacity: hidden ? 0 : loading ? 0.5 : 1 ,
562+ duration: Duration (milliseconds: hidden ? 2000 : 300 ),
563+ curve: Curves .easeOut,
564+ child: child);
565+ }
566+ }
567+
547568class RecipientHeader extends StatelessWidget {
548569 const RecipientHeader ({super .key, required this .message, required this .narrow});
549570
You can’t perform that action at this time.
0 commit comments