Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.63 KB

File metadata and controls

39 lines (28 loc) · 1.63 KB

This is a very barebones implementation of a timer.

Features

  • The timer ticks every updateInterval duration and displays the duration as specified by the builder function.
  • Controller can be passed to control the timer.
  • The time can be paused using pause and resumed using start.
  • The timer finishes when the time reaches zero and reaches the finished state. It can be reset by calling updateDuration with a new duration and calling start.
  • The timer state can be obtained using the state property.
  • The timer state can be also be observed as it changes using the stateStream property.
  • The time can be updated by passing a new duration to the updateDuration function.
  • Rest you can add on your own. The package is very simple and easy to build upon.

Getting started

Just add the package to your pubspec.yaml file and import it.

Usage

Usage examples are in the /example folder.

Additional information

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.