dispatchFunction method
void
dispatchFunction(
- ListPullHeaderViewModel viewModel,
- String functionName,
- VoltronArray array, {
- 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();
});
}
}
}