felangel / flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
https://pub.dev/packages/flow_builder
MIT License
395 stars 65 forks source link

Change terminology or maybe update the docs #31

Closed Ascenio closed 3 years ago

Ascenio commented 3 years ago

The first time I read the docs, I wasn't really sure what was the use of context.flow<T>().complete. I mean, in the source there's a comment where it says it triggers onComplete method, which cause a pop in the navigation (if I understood correctly). But I think that's kinda confusing because the onGenerateRoute can achieve similar behavior, as you get to decide when to pop routes and also trigger events. I think either the complete should get a different name or there should be a more in depth description about it in the README, with hints to when to use or some examples, maybe.

felangel commented 3 years ago

Hi @Ascenio 👋 Thanks for opening an issue!

But I think that's kinda confusing because the onGenerateRoute can achieve similar behavior, as you get to decide when to pop routes and also trigger events.

context.flow<T>().complete should be used to complete the entire flow. Can you provide some more context around how you'd exit the entire flow from onGeneratePages? In onGeneratePages you can control what the current navigation stack is but you can't exit the entire flow. Thanks! 🙏

Ascenio commented 3 years ago

After I tried the example from the repo it made sense. Thanks for responding and making the package, sounds very helpful. Actually the naming is nice, my problem was just that because I didn't know what the package was for, the name of the method didn't made sense. Good job.

Keep it up :smiley: