HttpViewModel class

Inheritance
Mixed in types

Constructors

HttpViewModel({Object? key})

Properties

hashCode int
The hash code for this object.
no setterinherited
httpRequestTokens List<HttpRequestToken>
no setterinherited
key Object?
创建时传入 用于区分由谁实例化了ViewModel。
finalinherited
notifyCall ← dynamic
no getterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateCall ← dynamic
no getterinherited

Methods

anHttp<T>(Param param, {HttpMethodType method = HttpMethodType.post, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, HttpRequestToken? cancelToken}) Future<Response<T>>
dio 原始返回类型 请求
inherited
anHttpArray<T>(Param param, {required JsonArrayConvertor<T> convertor, HttpMethodType method = HttpMethodType.post, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, HttpRequestToken? cancelToken}) Future<List<T>>
http请求, 用于返回值是数组的请求。 convert 数据类型转换器。
inherited
anHttpJson<T>(Param param, {required JsonObjectConvertor<T> convertor, HttpMethodType method = HttpMethodType.post, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, HttpRequestToken? cancelToken}) Future<T>
http请求, 用于返回值是Object的请求。 convert 数据类型转换器。
inherited
dismissLoading() → void
inherited
dispose() → void
inherited
disposeRequestToken() → void
inherited
finish([Object? data]) → void
inherited
lifeCancelToken([HttpRequestToken? requestToken]) HttpRequestToken
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendNotify(String message, {int? what, Object? data}) → void
inherited
setScopeState(VoidCallback fn, {bool notify = true}) → void
通知所持有ViewModel的State组件更新。 notify 参数表示可关闭通知更新,只执行fn。
inherited
setState<T>(LiveData liveData, LiveDataCallBack<T> fn, {bool notify = true}) → void
通知订阅LiveData的组件更新。 notify 参数表示可关闭通知更新,只执行fn。
inherited
showLoading({Widget? widget}) → void
inherited
toast(String message, {int duration = 2, ToastAlignment alignment = ToastAlignment.bottom, Widget? widget}) → void
inherited
toString() String
A string representation of this object.
inherited
useState<T>(T value, {bool notify = false}) LiveData<T>
创建 ViewModelState notify 创建时是否更新状态
inherited

Operators

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