An easy way to use count down
- Open the
pubspec.yaml
file, and addsimple_countdown: <latest_version>
undedependencies
:
dependencies:
flutter:
sdk: flutter
# ...
# ...
simple_countdown: ^0.0.1
- install it from terminal: Run
flutter packages get
import 'package:flutter/material.dart';
import 'package:simple_countdown/simple_countdown.dart';
void main() => runApp(MaterialApp(
home: Scaffold(
body: Center(
child: Countdown(
seconds: 10,
onFinish: () {
print('Finish');
},
textStyle: TextStyle(fontSize: 25, color: Colors.white),
),
),
),
));