getUsers method
Implementation
Future<void> getUsers() async {
if (await AppUtils.isNetConnected()) {
searching = true;
Mirrorfly.getUserList(pageNum, search.text.trim().toString()).then((value) {
if (value != null) {
var list = userListFromJson(value);
if (list.data != null) {
if (_mainuserList.isEmpty) {
_mainuserList.addAll(list.data!);
}
scrollable(list.data!.length == 20);
_userList.addAll(list.data!);
_userList.refresh();
} else {
scrollable(false);
}
}
searching = false;
}).catchError((error) {
debugPrint("issue===> $error");
searching = false;
});
} else {
toToast(AppConstants.noInternetConnection);
}
}