@@ -518,6 +518,7 @@ class _MarkAsReadWidgetState extends State<MarkAsReadWidget> {
518
518
padding: const EdgeInsets .symmetric (horizontal: 10 , vertical: 10 - ((48 - 38 ) / 2 )),
519
519
child: FilledButton .icon (
520
520
style: FilledButton .styleFrom (
521
+ splashFactory: NoSplash .splashFactory,
521
522
minimumSize: const Size .fromHeight (38 ),
522
523
textStyle:
523
524
// Restate [FilledButton]'s default, which inherits from
@@ -543,7 +544,7 @@ class _MarkAsReadWidgetState extends State<MarkAsReadWidget> {
543
544
}
544
545
}
545
546
546
- class MarkAsReadAnimation extends StatelessWidget {
547
+ class MarkAsReadAnimation extends StatefulWidget {
547
548
final bool loading;
548
549
final bool hidden;
549
550
final Widget child;
@@ -555,13 +556,34 @@ class MarkAsReadAnimation extends StatelessWidget {
555
556
required this .child
556
557
});
557
558
559
+ @override
560
+ State <MarkAsReadAnimation > createState () => _MarkAsReadAnimationState ();
561
+ }
562
+
563
+ class _MarkAsReadAnimationState extends State <MarkAsReadAnimation > {
564
+ bool _isPressed = false ;
565
+
566
+ void _setIsPressed (bool isPressed) {
567
+ setState (() {
568
+ _isPressed = isPressed;
569
+ });
570
+ }
571
+
558
572
@override
559
573
Widget build (BuildContext context) {
560
- return AnimatedOpacity (
561
- opacity: hidden ? 0 : loading ? 0.5 : 1 ,
562
- duration: const Duration (milliseconds: 500 ),
563
- curve: Curves .easeOut,
564
- child: child);
574
+ return GestureDetector (
575
+ onTapDown: (_) => _setIsPressed (true ),
576
+ onTapUp: (_) => _setIsPressed (false ),
577
+ onTapCancel: () => _setIsPressed (false ),
578
+ child: AnimatedScale (
579
+ scale: _isPressed ? 0.95 : 1 ,
580
+ duration: const Duration (milliseconds: 100 ),
581
+ curve: Curves .easeOut,
582
+ child: AnimatedOpacity (
583
+ opacity: widget.hidden ? 0 : widget.loading ? 0.5 : 1 ,
584
+ duration: const Duration (milliseconds: 500 ),
585
+ curve: Curves .easeOut,
586
+ child: widget.child)));
565
587
}
566
588
}
567
589
0 commit comments