BaseOptions class

A set of base settings for each Dio(). BaseOptions and Options will be merged into one RequestOptions before sending the requests. See Options.compose.

Mixed-in types

Constructors

BaseOptions({String? method, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, String baseUrl = '', Map<String, dynamic>? queryParameters, Map<String, dynamic>? extra, Map<String, dynamic>? headers, bool? preserveHeaderCase = false, ResponseType? responseType = ResponseType.json, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat})

Properties

baseUrl String
Request base url, it can be multiple forms:
getter/setter pairinherited
connectTimeout Duration?
Timeout when opening a request.
getter/setter pairinherited
contentType String?
getter/setter pairinherited
extra Map<String, dynamic>
getter/setter pairinherited
followRedirects bool
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>
getter/setter pairinherited
listFormat ListFormat
getter/setter pairinherited
maxRedirects int
getter/setter pairinherited
method String
getter/setter pairinherited
persistentConnection bool
getter/setter pairinherited
preserveHeaderCase bool
getter/setter pairinherited
queryParameters Map<String, dynamic>
Common query parameters.
getter/setter pairinherited
receiveDataWhenStatusError bool
getter/setter pairinherited
receiveTimeout Duration?
getter/setter pairinherited
requestEncoder RequestEncoder?
getter/setter pairinherited
responseDecoder ResponseDecoder?
getter/setter pairinherited
responseType ResponseType
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration?
getter/setter pairinherited
validateStatus ValidateStatus
getter/setter pairinherited

Methods

copyWith({String? method, String? baseUrl, Map<String, dynamic>? queryParameters, String? path, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, Map<String, Object?>? extra, Map<String, Object?>? headers, bool? preserveHeaderCase, ResponseType? responseType, String? contentType, ValidateStatus? validateStatus, bool? receiveDataWhenStatusError, bool? followRedirects, int? maxRedirects, bool? persistentConnection, RequestEncoder? requestEncoder, ResponseDecoder? responseDecoder, ListFormat? listFormat}) BaseOptions
Create a BaseOptions from current instance with merged attributes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited