You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @heshesh2010.
Your problem is the same as the one of this issue.
Try using the same solution I provided there. If you face any problems implementing it, or if it doesn't work, please contact me on the chat and I'll be glad to help you.
Hi ,
i'm using mvc pattren here is snap of my code :
final PagingController<int, Restaurant> pagingNearRestaurantsController =
PagingController(firstPageKey: 0);
HomeController() {
pagingNearRestaurantsController.addPageRequestListener((pageKey) {
// _con.listenForOrders(pageKey);
// orderRepo.fetchPosts(orderRepo.nextUrl);
_fetchNearRestaurantsPage(pageKey);
});
}
Future _fetchNearRestaurantsPage(pageKey) async {
}
Future<List> getNearRestaurants(
Address myLocation, Address areaLocation,uri) async {
if(uri==null) {
uri = Helper.getUri('api/restaurants');
Map<String, dynamic> _queryParams = {};
SharedPreferences prefs = await SharedPreferences.getInstance();
Filter filter = Filter.fromJSON(
json.decode(
prefs.getString('filter') ?? new Filter("opened").toJson()));
}
else
uriFinal=uri;
}
////
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The getter 'iterator' was called on null.
Receiver: null
Tried calling: iterator
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 new List.from (dart:core-patch/array_patch.dart:57:19)
#2 PagingController.notifyStatusListeners (package:infinite_scroll_pagination/src/core/paging_controller.dart:134:28)
#3 PagingController.value= (package:infinite_scroll_pagination/src/core/paging_controller.dart:175:7)
#4 PagingController.error= (package:infinite_scroll_pagination/src/core/paging_controller.dart:59:5)
#5 HomeController._fetchNearRestaurantsPage (package:foodlobby_client_app/src/controllers/home_controller.dart:72:39)
#6 new HomeController. (package:foodlobby_client_app/src/controllers/home_controller.dart:40:7)
#7 PagingController.notifyPageRequestListeners. (package:infinite_scroll_pagination/src/core/paging<…
The text was updated successfully, but these errors were encountered: