This is a very barebones implementation of a timer.
- The timer ticks every
updateIntervalduration and displays thedurationas specified by thebuilderfunction. - Controller can be passed to control the timer.
- The time can be paused using
pauseand resumed usingstart. - The timer finishes when the time reaches zero and reaches the
finishedstate. It can be reset by callingupdateDurationwith a new duration and callingstart. - The timer state can be obtained using the
stateproperty. - The timer state can be also be observed as it changes using the
stateStreamproperty. - The time can be updated by passing a new
durationto theupdateDurationfunction. - Rest you can add on your own. The package is very simple and easy to build upon.
Just add the package to your pubspec.yaml file and import it.
Usage examples are in the /example folder.
This package was built for usage in turn based games. There are no packages that do the time management properly while being very lightweight. So i made my own.