dispatchFunction method

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

Implementation

@override
void dispatchFunction(
  ListPullHeaderViewModel viewModel,
  String functionName,
  VoltronArray array, {
  Promise? promise,
}) {
  if (collapsePullHeader == functionName) {
    var listViewModel = viewModel.parent;
    if (listViewModel is ListViewModel) {
      listViewModel.refreshEventDispatcher.refreshComplected();
    }
  } else if (collapsePullHeaderWithOptions == functionName) {
    var listViewModel = viewModel.parent;
    if (listViewModel is ListViewModel) {
      var timeMap = array.get<VoltronMap>(0);
      var time = timeMap?.get<int>('time') ?? 0;
      Future.delayed(Duration(milliseconds: time), () {
        listViewModel.refreshEventDispatcher.refreshComplected();
      });
    }
  }
}