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

Using RefreshIndicator with built_redux #103

Open
jkyon opened this issue Nov 1, 2018 · 2 comments
Open

Using RefreshIndicator with built_redux #103

jkyon opened this issue Nov 1, 2018 · 2 comments

Comments

@jkyon
Copy link

jkyon commented Nov 1, 2018

Hi
First of all, thank you all for this library, it is just amazing. I´ve enjoyed learning this architecture and implementing it on a project in the company where a I´m working now.

I'm really new to Flutter and Dart, so I have a question. I want to use a pull to refresh which sends an action and retrieves a new set of items from the rest api via the middleware. I need to use RefreshIndicator, but the indicator needs a Future passed to it (onRefresh) that resolves when the action has finished. Is there any way that I can use the existing stock widget to start and stop based on actions?

Thank you in advance!

@zoechi
Copy link
Contributor

zoechi commented Nov 2, 2018

I don't see how this is built_redux related. I'd suggest to create a StackOverflow question with more details

@maxlapides
Copy link

This issue is related: flutter/flutter#11675. It makes sense to me that the RefreshIndicator API could be improved.

I also opened this issue on the thunk package: davidmarne/built_redux_thunk#8. If thunks could return futures, you could have the future available to pass to RefreshIndicator.

IncPlusPlus added a commit to IncPlusPlus/betterstat-mobile that referenced this issue Jun 3, 2020
With some effort, I have successfully managed to smuggle a new class called SpecializedCompleterTuple through some actions such that the middleware can have some influence on a UI widget which originally constructed (and is listening to the futures inside of) the SpecializedCompleterTuple. My purposes for doing this are outlined in the documentation of SpecializedCompleterTuple.

I'm justifying how jank this system is because it's not far off from what Brian Egan recommended (brianegan/flutter_redux#6 (comment)). However, I do hope I find something cleaner than this for the future. This also relates to Workiva/built_redux#103 and flutter/flutter#11675.
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