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
I created json file which includes all paths for the images. With this file I want to work as future source in flutter_pagewise.
The function which returns the list from json for pagewise
Future<List> getDemoImagesJson(int offset, int limit) async {
String demoImages = await DefaultAssetBundle.of(context)
.loadString("assets/demo/demo.json");
final jsonResult = json.decode(demoImages);
List images = [];
for (var i in jsonResult) {
images.add({"id": 1, "title": "sample", "thumbnailUrl": i});
}
final list = List.from(images).toList();
var listWithOffset = list.skip(offset).toList();
final finalList = listWithOffset.getRange(0, limit).toList();
return ImageModel.fromJsonList(finalList);
}
The ImageModel class (copied from official documentation)
What I expect: I expect that the Widget loads only 10 images and after I scroll down to the end of the page it loads other 10 images...until all images did load.
What I get: The Widget loads all images at once (as batch). There is no lazyload effect after reaching the bottom of the page.
Where is the issue?
The text was updated successfully, but these errors were encountered:
I created json file which includes all paths for the images. With this file I want to work as future source in flutter_pagewise.
The function which returns the list from json for pagewise
The ImageModel class (copied from official documentation)
The PageWise Widget
What I expect: I expect that the Widget loads only 10 images and after I scroll down to the end of the page it loads other 10 images...until all images did load.
What I get: The Widget loads all images at once (as batch). There is no lazyload effect after reaching the bottom of the page.
Where is the issue?
The text was updated successfully, but these errors were encountered: