timerun 0.8.3
timerun: ^0.8.3 copied to clipboard
Is a timer library for Flutter that allows you to easily manage timers with customizable configurations. You can use this library to implement timers in your Flutter applications in a simple and flexible way.
timerun - A Timer Library for Flutter #
timerun is a timer library for Flutter that allows you to easily manage timers with customizable configurations. You can use this library to implement timers in your Flutter applications in a simple and flexible way.
Installation #
To get started with timerun, add the following line to your pubspec.yaml file:
dependencies:
timerun: ^0.8.0 # Replace this with the latest version of the library
Then run the command flutter pub get to install the library.
Basic Usage #
Import the library in your Dart file:
import 'package:timerun/timerun.dart';
Create a Timer
TimeRun myTimer = TimeRun(
series: 3,
repetitions: 10,
pauseSeries: 30,
pauseRepeition: 10,
time: 60,
onUpdate: (currentSeries, currentRepetition, currentTime, totalSeries, totalRepetitions, timerState) {
// Logic to handle timer updates
},
onFinish: () {
// Logic to handle when the timer finishes
},
onChange: (timerState) {
// Logic to handle changes in timer state (play, pause, stop)
},
);
Control the Timer
await myTimer.play(); // Start the timer
await myTimer.pause(); // Pause the timer
await myTimer.resume(); // Resume the timer
await myTimer.stop(); // Stop the timer
Parameters
series: Number of series in the timer.repetitions: Number of repetitions per series.pauseSeries: Pause time between series (in seconds).pauseRepeition: Pause time between repetitions (in seconds).time: Duration of each repetition (in seconds).onUpdate: Function called on each timer update.onFinish: Function called when the timer finishes.onChange: Function called when the timer state changes (play, pause, stop).
And that's it! Now you are ready to start using the timerun library in your Flutter application.