BaseApi<T> class abstract

Inheritance
Implementers

Constructors

BaseApi(String url, {HttpMethod httpMethod = HttpMethod.get})

Properties

formData ↔ FormData?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
httpMethod HttpMethod
final
interceptions ↔ ISet<Interceptor>
getter/setter pair
options ↔ BaseOptions
getter/setter pair
params Map<String, dynamic>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showLog bool
getter/setter pair
url String
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
beforeHandleDartTypeModel(DartTypeModel model, RequestParams requestParams, Response response) → void
closeLoading() → void
covertToModel(DartTypeModel data, RequestParams param) → T
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
download([RequestParams options = const RequestParams()]) Future<T>
下载文件
getDio(BaseOptions baseOptions) Future<Dio>
getMediaType(String filename) String
getOptions(RequestParams param) Future<BaseOptions>
handle(CallIf callIf, ValueChanged<BaseApi> call) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
printLog(dynamic log) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
request([RequestParams options = const RequestParams()]) Future<T>
isFullUrl - url传入的是否为完整的一个URL,如果为true,将忽略host
showLoading({String? loadingText}) → void
toString() String
A string representation of this object.
inherited

Operators

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