CancelToken constructor Null safety

CancelToken(
  1. {Duration? timeout}
)

Implementation

CancelToken({
  this.timeout,
}) {
  if (timeout != null) {
    _timer = Timer(timeout ?? Duration.zero, () => cancel());
  }
}