getEventListing function

Future<void> getEventListing(
  1. {bool isFromBottom = false,
  2. bool isFromSort = false,
  3. bool isSaveFilter = false,
  4. bool isFromReset = false}
)

Implementation

Future<void> getEventListing({bool isFromBottom = false, bool isFromSort = false, bool isSaveFilter = false, bool isFromReset = false}) async {
  log("-------------- Event Api Call -------------");
  appStore.setLoading(true);
  await getEventList(isSaveFilter: isSaveFilter, isFromReset: isFromReset).then((value) {
    if (value?.eventListData != null) {
      (isFromSort) ? appStore.sortAddEventData(value!.eventListData!) : appStore.addEventData(value!.eventListData!);
    }
    appStore.setLoading(false);
  }).catchError((e) {
    toast(e.toString(), print: true);
    appStore.setLoading(false);
  });
}