getList method

Future<void> getList()

Get users

Implementation

Future<void> getList() async {
  _loading = true;
  notifyListeners();
  try {
    await Future.delayed(const Duration(seconds: 2));
    _models = await service.getList();
  } catch (e) {
    _error = e.getMessage();
  }
  _loading = false;
  notifyListeners();
}