fountain icon indicating copy to clipboard operation
fountain copied to clipboard

Provide a more complex example

Open irvine5k opened this issue 3 years ago • 7 comments

I was from the time of Scoped Model, so I tried a lot of approaches of state management and I can say that Fountain is really interesting, and by the docs and visual identity, I can see that you put your heart into it. Nice job!

I liked the idea of separate actions instead of a class that handles all of them. The state injection in the widget tree is really easy, and since it's a global state, we can eliminate duplicated code(Providers everywhere). You brought the redux idea of middlewares, which is really useful to automate some boilerplate stuff like Analytics, Logging, Mock.

I only miss a more complex example that can better explain how the global state is built and the view listens only to one part of it.

irvine5k avatar May 05 '21 18:05 irvine5k

Thanks a lot for your comment!

Sure, I will add a real world example soon!

If you have any suggestions for features that may be complex to implement, to test the edge cases, don't hesitate!

aloisdeniel avatar May 05 '21 19:05 aloisdeniel

I have some suggestions: Authentication, Deep Link(Create or Feed State by URL information), Dependency Injection(Can be done by Middlewares?), Wizard/Stepper, Offline Persistence.

But there's one case that's used by many big companies and it's really unexplored: Monorepo/Packages Architecture/Micro apps. Every feature of an app is a package, it's tricky because we need to register the "modules" routes, dependencies, and so on.

https://rodrigolmti.medium.com/building-a-multi-package-project-with-flutter-6c547d18abd5

irvine5k avatar May 05 '21 19:05 irvine5k

We can not forget automated tests. Widget and Unit are enough I guess.

If you provide one of these examples I can help with tests and other examples. Just need some direction because I don't have experience with a global state.

irvine5k avatar May 05 '21 19:05 irvine5k

I would also recommend adding something about error handling! That's one overlooked issue (pun intended) on most state management tools on Flutter that would be nice to see explored here; good job overall!

gildaswise avatar May 05 '21 23:05 gildaswise

I started to work on the documents example !

I started with state first, but it is a good start to see how I'm using the tool.

aloisdeniel avatar May 11 '21 05:05 aloisdeniel

It's definitely a good start, thank you.

I have doubts if using another package(freezed) to demonstrate the package is good. I think you added an additional cognitive load to people understand the sample since you need to digest two concepts in a row.

Don't get me wrong, I appreciated your effort and freezed is a good package.

irvine5k avatar May 13 '21 06:05 irvine5k

Hi!

The idea of the documents example is to have a "real-world" example. And honestly, I couldn't imagine using the package without freezed, or without data classes at the language level...

I will probably integrate an intermediate example afterwards with the bare minimum because, as you said the learning curve is tough if you're not familiar with freezed.

aloisdeniel avatar May 20 '21 09:05 aloisdeniel