Stopwatch
An elapsed-time stopwatch that counts up. Call .start(), .stop() and .reset(), and forward TickMsg to advance elapsed.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

var watch = StopwatchModel();
watch = watch.start();
// each TickMsg:
final (next, cmd) = watch.update(tickMsg);
print(next.elapsed); // Duration since startStopwatchModel
| Property | Type | Description |
|---|---|---|
| elapsed | Duration | Accumulated elapsed time. |
| running | bool | Whether the stopwatch is running. |