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

home route quirk #48

Closed
sensiblearts opened this issue Feb 7, 2019 · 4 comments
Closed

home route quirk #48

sensiblearts opened this issue Feb 7, 2019 · 4 comments

Comments

@sensiblearts
Copy link

Greetings,
I opened an issue earlier today but then closed it when I realized that it was a flutter isssue, not a flutter_pagewise issue.

However, this may help you:

Flutter seems to initialize the home route in parallel with the main widget initialization.

Therefore, if you happen to be using a PagewiseListView on your home route, then PagewiseListview will attempt to render, but finding an empty list of entries, will show only the retry button.

 child: MaterialApp(
        home: EntriesPage(),   // problem if this widget contains a PagewiseListView
        routes: {
        //...
        }

So, probably what I will do is show a splash screen until data is initialized.
Hope this helps,
DA

@sjmcdowall
Copy link
Collaborator

sjmcdowall commented Feb 7, 2019 via email

@AbdulRahmanAlHamali
Copy link
Owner

I think the error that you were facing might be because of _entries.sublist that you showed in your other issue. The list is probably starting empty, and you are trying to take a sublist out of it.

I have to ask, though: why are you using Pagewise with a local list? The purpose of Pagewise is to load data from a remote server one page at a time. I suspect you might be using the tool the wrong way

@sensiblearts
Copy link
Author

Yes, I should have written back later yesterday when I figured that out!

I am no longer using the local List _entries, and everything works smoothly and more efficiently.

Much less code, too.

Thank you for this work!

You might consider adding something to your readme, saying something like, "PageWise caches the data internally. You can simply write your pageFuture(pageIndex) function to return the results of querying your local or remote database."
DA

@AbdulRahmanAlHamali
Copy link
Owner

Cool! Yeah not a bad thing to mention. Thank you David!

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

3 participants