loadData method

Future loadData()

Implementation

Future loadData() async {
  try {
    final listValue = await apiLoadData(isFirst: true);
    if (listValue is List) {
      list = listValue;
      updateData(listValue);
    }
  } catch (e, stack) {
    if (DudvConfig.catchError != null) {
      DudvConfig.catchError!(e, stack);
    }
    debugPrint('$e $stack');
    if (showErr) {
      if (DudvConfig.showError != null) {
        DudvConfig.showError!(e.toString());
      } else {
        if (_navigator.mounted) {
          Utils.handleError(context, e);
        }
      }
    } else {
      handleError(e);
    }
  }
  isFirst = false;
  updateState(list);
}