PacedTerminalWriter constructor

PacedTerminalWriter(
  1. Terminal terminal, {
  2. Duration frameBudget = const Duration(milliseconds: 8),
  3. Future<void> waitForFrame()?,
  4. Stopwatch createStopwatch()?,
})

Implementation

PacedTerminalWriter(
  this.terminal, {
  this.frameBudget = const Duration(milliseconds: 8),
  Future<void> Function()? waitForFrame,
  Stopwatch Function()? createStopwatch,
})  : _waitForFrame = waitForFrame ?? _endOfFrame,
      _createStopwatch = createStopwatch ?? Stopwatch.new {
  if (frameBudget <= Duration.zero) {
    throw ArgumentError.value(frameBudget, 'frameBudget', 'must be positive');
  }
}