createFromInput static method

KeepAliveTimer createFromInput(
  1. KeepAliveTimerInput input
)

Implementation

static KeepAliveTimer createFromInput(KeepAliveTimerInput input) {
  if (input.existingTimer != null) {
    return KeepAliveTimer.from(input.existingTimer!);
  }
  if (input.duration != null && input.callback != null) {
    return KeepAliveTimer.periodic(input.duration!, input.callback!);
  }
  throw ArgumentError(
      'KeepAliveTimerInput must include either existingTimer or (duration and callback)');
}