rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
6.28k stars 957 forks source link

Port the Flutter skeleton app to Riverpod #956

Open rrousselGit opened 2 years ago

rrousselGit commented 2 years ago

For the sake of example

TimWhiting commented 2 years ago

I think we should maybe integrate a dartpad workshop or example for this into the documentation: https://github.com/dart-lang/dart-pad/wiki/Workshop-Authoring-Guide. I'm not sure if workshops are embeddable into external websites currently, but the basic editor with tests / solutions is.

At the very least, I think we should add it to the cli so you can do riverpod create scaffold. In general I think it would be good to let the cli create some starting code / ending code for the examples in the documentation.

I'm happy to work on this if you haven't already started work for it. Maybe we should talk about whether it is worth continuing the current PR for documentation or starting from scratch with a more introduction via tutorials / example use cases approach with a separate more reference oriented section. Rather than organized by feature. (It is still important to have the feature reference section, but not necessarily for introduction / learning).

The cli could also have riverpod create counter/marvel/etc...

rrousselGit commented 2 years ago

Yeah I was thinking of adding a bunch of tutorials too. Like "Riverpod for Provider users" or "How to implement pull-to-refresh", this sort of thing.

But if we're going for this, I think an important first step is a testing suite that extracts dart code from docs/dartdoc and validates it (that and hyperlink validation too). They tend to get outdated too often

A CLI is be interesting too. I voluntarily picked a generic name for the migration tool so that we can do a "riverpod create" or "riverpod analyze"

Solido commented 2 years ago

Now that Riverpod is stable I can share my feeling that the current document can be too dense for newcomers and it is time for a 'Cookbook' approach. Real life examples like 'pull to refresh' you cite would help adoption a lot and I would happily join you guys providing code here and here.

Having those light demonstrations integrated in the documentation page as copy-paste and link to dartpad would be a very enjoyable learning experience.

Solido commented 2 years ago

Long term objectives but I put it here as an idea that may be reachable in the future

Riverpod Cookbook

Basic examples, common use-cases and widely adopted libraries applied to Riverpod registered by labels. So if I click navigation I can find snippets or basic working examples of let say go-router, etc

rrousselGit commented 2 years ago

@Solido I'd love some help!

A helpful first step would be regrouping all the various example ideas or criticisms in a single point. I've made an issue for that: https://github.com/rrousselGit/river_pod/issues/1035

Because at the moment there are ideas all over the place (including closed issues), so I'll most definitely forget some

Solido commented 2 years ago

Hi @rrousselGit Bonne Année 2022! Santé et Projets ;)

Is there a way to setup a quick meeting or something more direct to clarify the aim?

rrousselGit commented 2 years ago

Thanks! You too!

Sure. You know where to find me

RandalSchwartz commented 2 years ago

I have a skeleton minimal app using HookConsumer for all widget types. It's tied in to VSC's short expansion, so I don't know enough about packaging that up. But I will be doing a screencast on it soon.

wederchr commented 2 years ago

Hi @rrousselGit I've been working on a custom template based on the skeleton app. Part of that work was to migrate it to use riverpod. It's also using packages like freezed and go_router. I was thinking of creating a pull request to add it to the examples folder. Is that something you'd be interested in?

rrousselGit commented 2 years ago

Hi!

I currently do not accept pull request adding "official" examples (example folder).

If you want to add your example to the website, it'll be in the third party list

wederchr commented 2 years ago

I see, thx for quick response. I don't want to open source the template yet as it is a wip and heavily opinionated. It would've just been the riverpod migration part.

hectorAguero commented 1 year ago

I did a port of the flutter skeleton to riverpod here https://github.com/hectorAguero/riverpod_skeleton

Now I think that this kind of template is not the best to show the riverpod skills while providing a structure folder to start a medium/large project.

I'd like to see something like that as an official example step by step, I already read here that examples would be unchanged in documentation rework plan, but would be great to have one of them explained by steps to show the skills of riverpod and the async management of the package.