Flutter get User is not working

void getUsers(AmityUserSortOption amityUserSortOption) {
    try {
      /// Checking make sure user is loggedIn
      bool ids = AmityCoreClient.isUserLoggedIn();
      _amityUsersController = PagingController(
        pageFuture: (token) => AmityCoreClient.newUserRepository()
            .getPagingData(token: token, limit: 20),
        pageSize: 20,
          () {
            if (_amityUsersController.error == null) {
              //handle _amityUsersController, we suggest to clear the previous items
              //and add with the latest _controller.loadedItems
              //update widgets
            } else {
              //error on pagination controller
              //update widgets
    } catch (e) {

Hi @AmSK

This issue occurs because _amityUsersController needs to be trigger once. Please find the code below to trigger the first fetch:

 WidgetsBinding.instance.addPostFrameCallback((timeStamp) {

Anything else please don’t hesitate to let us know.
Amity Support