dispatchFunction method

  1. @override
void dispatchFunction(
  1. ListPullFooterViewModel viewModel,
  2. String functionName,
  3. VoltronArray array, {
  4. Promise? promise,
})
override

Implementation

@override
void dispatchFunction(ListPullFooterViewModel viewModel, String functionName, VoltronArray array,
    {Promise? promise}) {
  if (collapsePullFooter == functionName) {
    var listViewModel = viewModel.parent;
    if (listViewModel is ListViewModel) {
      // delay to keep data update first
      Future.delayed(const Duration(milliseconds: 0), () {
        WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
          listViewModel.refreshEventDispatcher.loadingCompleted();
          // fire postFrameCallback
          WidgetsBinding.instance.scheduleFrame();
        });
      });
    }
  }
}