| 1 | import 'package:animated_flip_counter/animated_flip_counter.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | import 'dart:ui'; |
| 4 | |
| 5 | class RefreshCountdownTimer extends StatelessWidget |
| 6 | final int secondsRemaining; |
| 7 | |
| 8 | const RefreshCountdownTimer({ |
| 9 | super.key, |
| 10 | required this.secondsRemaining, |
| 11 | }); |
| 12 | |
| 13 | @override |
| 14 | Widget build(BuildContext |
| 15 | return ClipRRect( |
| 16 | borderRadius: BorderRadius.circular( |
| 17 | child: BackdropFilter( |
| 18 | filter: ImageFilter.blur(sigmaX |
| 19 | child: Container( |
| 20 | padding: EdgeInsets.symmetric(horizontal |
| 21 | decoration: BoxDecoration( |
| 22 | color: Colors.black.withOpacity |
| 23 | borderRadius: BorderRadius.circular( |
| 24 | border: Border.all( |
| 25 | color: Colors.white.withOpacity |
| 26 | width: 1, |
| 27 | ), |
| 28 | ), |
| 29 | child: Row( |
| 30 | mainAxisSize: MainAxisSize.min, |
| 31 | children: [ |
| 32 | Icon( |
| 33 | Icons.refresh, |
| 34 | color: Colors.white, |
| 35 | size: 13, |
| 36 | ), |
| 37 | SizedBox(width: 4), |
| 38 | AnimatedFlipCounter( |
| 39 | value: secondsRemaining, |
| 40 | duration: Duration(milliseconds: 300 |
| 41 | textStyle: TextStyle( |
| 42 | color: Colors.white, |
| 43 | fontSize: 13, |
| 44 | fontWeight: FontWeight.bold, |
| 45 | letterSpacing: 0.5, |
| 46 | ), |
| 47 | ), |
| 48 | Text( |
| 49 | 's', |
| 50 | style: TextStyle( |
| 51 | color: Colors.white, |
| 52 | fontSize: 13, |
| 53 | fontWeight: FontWeight.bold, |
| 54 | letterSpacing: 0.5, |
| 55 | ), |
| 56 | ), |
| 57 | ], |
| 58 | ), |
| 59 | ), |
| 60 | ), |
| 61 | ); |
| 62 | } |
| 63 | } |
| 64 | |