Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading only 2 pages #80

Open
webrndexperts opened this issue Oct 19, 2019 · 2 comments
Open

Loading only 2 pages #80

webrndexperts opened this issue Oct 19, 2019 · 2 comments

Comments

@webrndexperts
Copy link

Issue #1:

PagewiseGridView.count(
pageSize: pageSize,
primary: true,
shrinkWrap: true,
crossAxisCount: 2,
childAspectRatio: 1,
padding: const EdgeInsets.only( top: 5.0),
itemBuilder: this._getStructuredGridCell,
pageFuture: (pageIndex) async{
return BackendService.getImages( pageIndex * pageSize, pageSize, merchantId, json.encode(categories), searchString );
}

  )

Using the above code. The first 2 pages load perfectly. But it shows the load more icon for the 3rd page but does not display the data. However, the API returns the data, I checked the api response.

Issue #2: The code works fine with http.get as it is shown in the example. But with .post it doesn't display the data.

http.post( requestUrl, body: { 'blah': blah } ).then( (http.Response response){
print(response.body);
return ProductModel.fromJsonList(json.decode(response.body);
});

Although, the api returns the data. But the itemBuilder don't get called.

I'll appreciate your quick reply.

@webrndexperts
Copy link
Author

I resolved issue #1. There was an error in the JSON, API was returning. int is not a subtype of string. I can to know about this issue by using

errorBuilder: (context, error){
print( error.toString() );
return Text( error.toString() );
},

@webrndexperts
Copy link
Author

Issue #2 was related to issue 1. All good now. Thank you for a wonderful package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant