animated_countdown_timer 0.1.4 animated_countdown_timer: ^0.1.4 copied to clipboard
A customizable countdown timer with animations and callbacks.
import 'package:flutter/material.dart';
import 'package:animated_countdown_timer/animated_countdown_timer.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Countdown Timer Example')),
body: Center(
child: AnimatedCountdownTimer(
initialCount: 5,
textColor: Colors.yellow,
overlayColor: Colors.black54,
showText: true, // Set to true to show countdown number and done text
doneText: "Time's Up!", // Custom text when countdown finishes
showFontSize: 32, // Font size for done text
numFontSize: 72, // Font size for countdown number
onStart: () {
debugPrint("Countdown started!");
},
onDone: () {
debugPrint("Countdown finished!");
},
),
),
),
);
}
}