A customizable, animated countdown timer for Flutter, inspired by Airbnb’s home page countdown timer for discount house rentals.
- ✅ Fully customizable countdown timer
- ✅ Multiple animation effects (Scale, Fade, Slide, Rotate)
- ✅ Option to show/hide hours, minutes, and seconds
- ✅ Customizable text style, background color, and blur effect
- ✅
onTick
callback for real-time countdown updates - ✅ Supports countdown and count-up modes
- ✅ Smooth digit transition animations
- ✅ Lightweight and easy to integrate
Add the following dependency to your pubspec.yaml
:
dependencies:
cool_timer: latest_version
Then, run:
flutter pub get
import 'package:cool_timer/cool_timer.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: ClockWidget(
duration: Duration(hours: 2, minutes: 30, seconds: 45),
selectedAnimation: AnimationType.fade,
onEnd: () => print("Time's up!"),
),
),
),
);
}
}
ClockWidget(
duration: Duration(minutes: 10),
showHours: false, // Hide hours if not needed
showSeconds: false, // Hide seconds if not needed
onEnd: () => print("Timer finished!"),
)
ClockWidget(
textStyle: TextStyle(fontSize: 40, color: Colors.red),
backgroundColor: Colors.black,
dividerColor: Colors.orange,
)
ClockWidget(
isBlur: true,
blurStrength: 15.0, // Adjust blur intensity
)
ClockWidget(
selectedAnimation: AnimationType.slide, // Options: fade, scale, slide, rotate
digitAnimationDuration: Duration(milliseconds: 300),
)
ClockWidget(
isReversed: true, // Starts from 00:00 and counts up
)
ClockWidget(
duration: Duration(minutes: 5),
onTick: (remainingTime) {
print('Remaining time: $remainingTime');
},
)
🎉 We'd love your feedback and contributions!
If you have ideas, improvements, or bug fixes, feel free to open a pull request or an issue. Your contributions make this package better for everyone.
If you like this package, please star ⭐ the repo and share your feedback!
If you find this package useful, consider supporting us with a GitHub star ⭐ or contributing via PRs! 🚀😊