StopwatchModel constructor

StopwatchModel({
  1. Duration interval = const Duration(milliseconds: 100),
  2. DateTime nowProvider()?,
})

Creates a new stopwatch model.

interval is how often the stopwatch ticks (defaults to 100 milliseconds).

Implementation

StopwatchModel({
  this.interval = const Duration(milliseconds: 100),
  DateTime Function()? nowProvider,
}) : _elapsed = Duration.zero,
     _running = false,
     _nowProvider = nowProvider ?? _defaultBubbleNowProvider,
     _id = _nextStopwatchId(),
     _tag = 0;