forState method

Duration? forState(
  1. RequestLifecycleState state
)

Returns the timeout for the specified state if there is one specified, otherwise returns null.

Implementation

Duration? forState(RequestLifecycleState state) {
  switch (state) {
    case RequestLifecycleState.connecting:
      return connectTimeout;
    case RequestLifecycleState.sending:
      return sendTimeout;
    case RequestLifecycleState.receiving:
      return receiveTimeout;
  }
}