Skip to content
pubscout

pausable_timer

3.1.0+3, released 3 years ago by mateusfccp.me

A Dart timer implementation that can be paused, resumed, and reset.

WASM-ready
$ flutter pub add pausable_timer
Source repository

What it does

Provides a timer class that tracks elapsed time and can be paused, resumed, reset, or run periodically. It exposes state flags like isPaused, isExpired, and isCancelled.

AI-written summary of version 3.1.0+3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a timer that can be temporarily paused and later resumed without losing elapsed progress
  • You require periodic timers with pause and reset capabilities

Skip it when

  • Standard Dart Timer functionality is entirely sufficient for your use case

Strengths

  • Supports pause, resume, reset, and cancel operations
  • Provides periodic timer support via PausableTimer.periodic

Weaknesses

  • Maintains an imperative state model that must be managed manually

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:pausable_timer/pausable_timer.dart';

void main() async {
  final timer = PausableTimer(Duration(seconds: 1), () => print('Fired!'));
  timer.start();
  timer.pause();
  timer.start();
}

Works with

Packages commonly used together with pausable_timer: ones it builds on, ones built on it, and its own family.