smart_timer 1.0.2 copy "smart_timer: ^1.0.2" to clipboard
smart_timer: ^1.0.2 copied to clipboard

A periodic timer which only runs while the app lifecycle is resumed.

Pub

smart_timer #

A periodic Timer which runs only while the app's lifecycle is resumed.

The default Dart timer also runs while the app is paused, e.g. if it is in the background. This can be useful sometimes, but often you might want to stop the timer to save resources. smart_timer listens to app lifecycle changes and pauses/resumes the timer accordingly.

Usage #

SmartTimer(
  duration: Duration(seconds: 1),
  onTick: () => print("Hello World"),
)
8
likes
110
pub points
74%
popularity

Publisher

unverified uploader

A periodic timer which only runs while the app lifecycle is resumed.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on smart_timer