Service class abstract

藉由build_runner實現

Http request service

Implemented types

Constructors

Service(String baseUrl, {Duration connectTimeout = const Duration(seconds: 5), Duration receiveTimeout = const Duration(seconds: 10), Duration sendTimeout = const Duration(seconds: 10), ValidateStatus? validateStatus})
baseUrl URL

Properties

baseUrl String
URL
final
connectTimeout Duration
connect timeout
final
dio Dio
The dio object
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
httpClientAdapter HttpClientAdapter
dio httpClientAdapter
getter/setter pair
interceptors Interceptors
dio interceptors
no setter
receiveTimeout Duration
receive timeout
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration
send timeout
final
transformer Transformer
dio transformer
getter/setter pair
url String
no setteroverride
validateStatus ValidateStatus?
validateStatus defines whether the request is successful for a given HTTP response status code. If validateStatus returns true , the request will be perceived as successful; otherwise, considered as failed.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request(List config, List<(dynamic, dynamic)> params) Future<Response>
傳送API
setBaseUrl(String url) → void
更改Url
toString() String
A string representation of this object.
inherited

Operators

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