Skip to content
pubscout

timer_builder

2.0.0, released 6 years ago by an unverified publisher

A Flutter widget that rebuilds its child on scheduled, periodic or dynamic time events.

WASM-ready
$ flutter pub add timer_builder
Source repository

What it does

TimerBuilder provides factory constructors to create widgets that automatically call setState at specified times. It can rebuild on a fixed interval, on a list of DateTime schedules, or on custom time streams. The widget works on all Flutter platforms.

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

Use it when

  • Displaying a live clock or countdown
  • Limiting UI rebuild frequency for frequently changing data
  • Showing time‑since or time‑until an event

Skip it when

  • Needing sub‑millisecond precision or heavy computational work on each tick
  • Complex UI logic that should be handled outside of a simple timer

Strengths

  • Simple, declarative API
  • Null‑safe and works on all platforms
  • No additional setup or code generation required

Weaknesses

  • Only handles time‑based rebuilds, no built‑in animation support
  • Can cause unnecessary rebuilds if overused

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:timer_builder/timer_builder.dart';

class ClockWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TimerBuilder.periodic(Duration(seconds: 1), builder: (context) {
      return Text('${DateTime.now()}');
    });
  }
}

Alternatives

Packages that do the same job and could replace timer_builder.

  • impression

    Detects user impression events for Flutter widgets.

  • datetime_loop

    Flutter widget that listens to system datetime and triggers rebuilds based on specified time units.