BaseRefreshController<E, T> class
abstract
下拉刷新,下拉加载 Controller
- Inheritance
-
- Object
- GetLifeCycle
- DisposableInterface
- GetxController
- BaseController
- BaseRefreshController
- Implemented types
Constructors
Properties
- appBarTitle → RxString
-
finalinherited
-
dataList
→ RxList<
T> -
no setter
- emptyMessage → String
-
no setterinherited
- errorMessage → String
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setterinherited
- initialized → bool
-
Checks whether the controller has already been initialized.
no setterinherited
- isClosed → bool
-
Checks whether the controller has already been closed.
no setterinherited
- listeners → int
-
no setterinherited
-
onDelete
→ InternalFinalCallback<
void> -
Internal callback that starts the cycle of this controller.
finalinherited
-
onStart
→ InternalFinalCallback<
void> -
Called at the exact moment the widget is allocated in memory.
It uses an internal "callable" type, to avoid any @overrides in subclases.
This method should be internal and is required to define the
lifetime cycle of the subclass.
finalinherited
- page → int
-
no setter
- refreshController ↔ EasyRefreshController
-
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
timers
→ List<
Timer> -
finalinherited
- viewState → ViewState
-
no setterinherited
Methods
-
$configureLifeCycle(
) → void -
inherited
-
addListener(
GetStateUpdate listener) → Disposer -
Register a closure to be called when the object notifies its listeners.
inherited
-
addListenerId(
Object? key, GetStateUpdate listener) → Disposer -
inherited
-
cancelRequest(
CancelToken cancelToken) → void -
取消某个网络请求
inherited
-
createApi<
API extends BaseApi> (API api) → API -
创建api,这个方法主要是将api绑定到VM中,VM销毁时会去cancel其中的未完成请求
inherited
-
createEasyRefreshController(
) → EasyRefreshController - 构建下拉刷新/上拉加载控制器
-
createLifecycleTimer(
Duration duration, void callback()) → Timer -
创建具备ViewModel生周期自动销毁的Timer
inherited
-
createPageResult(
BaseResp< E> resp) → PageResult<T> - 数据加载成功之后构建本次加载的列表数据,抽象方法,由子类具体实现
-
dispose(
) → void -
inherited
-
disposeId(
Object id) → void -
To dispose an
idfrom future updates(), this ids are registered byGetBuilder()or similar, so is a way to unlink the state change with the Widget from the Controller.inherited -
firstLoad(
) → void - 首次加载,主要用于进入页面时即触发数据加载,且不想要下拉刷新的动作
-
getDelayCreateDuration(
) → Duration -
界面切换时有动画效果,如果动画执行中进行网络请求的操作会导致动画卡顿
这里是延迟等动画效果结束后再进行网络请求等操作,时长建议是界面切换动画时长
inherited
-
getPageSize(
) → int - 每页数量,默认为0,子类可override重新定义
-
initPage(
) → int - 开始的页码,默认为0,子类可override重新定义
-
initViewState(
) → ViewState -
inherited
-
isFinishing(
) → bool -
inherited
-
loadData(
{required bool refresh, required int page, required int pageSize}) → Future< BaseResp< E> > -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChildrens(
) → void -
inherited
-
onClose(
) → void -
Called before
onDeletemethod.onClosemight be used to dispose resources used by the controller. Like closing events, or streams before the controller is destroyed. Or dispose objects that can potentially create some memory leaks, like TextEditingControllers, AnimationControllers. Might be useful as well to persist some data on disk.inherited -
onInit(
) → void -
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
inherited
-
onLoadMore(
) → void - 加载更多
-
onReady(
) → void -
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
-
onRefresh(
) → void - 刷新数据
-
onUiDelayReady(
) → void -
inherited
-
onUiDispose(
) → void -
inherited
-
onUiReady(
) → void -
inherited
-
refresh(
) → void -
inherited
-
refreshBuilder(
{required Widget child}) → EasyRefresh - 快速构建下拉刷新控件
-
refreshGroup(
Object id) → void -
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
removeListenerId(
Object id, VoidCallback listener) → void -
inherited
-
request<
T> ({required Future< BaseResp< future, bool isNeedLoading = true, bool isNeedDialogLoading = false, bool isShowErrorToast = false, bool isShowErrorDetailToast = false, OnSuccess<T> >T> ? onSuccess, OnFailed? onFailed}) → void -
同步回调的网络请求
inherited
-
retryOperation(
) → void -
显示错误界面的 重试操作方法 子类实现
inherited
-
inherited
-
showContent(
) → void -
显示内容
inherited
-
showEmpty(
) → void -
显示空状态
inherited
-
showError(
[String message = '']) → void -
显示错误
inherited
-
showLoading(
) → void -
显示加载状态
inherited
-
showToast(
String? msg) → void -
展示toast
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
[List< Object> ? ids, bool condition = true]) → void -
Rebuilds
GetBuildereach time you callupdate(); Can take a List ofids, that will only update the matchingGetBuilder( id: ),idscan be reused amongGetBuilderslike group tags. The update will only notify the Widgets, ifconditionis true.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited