nubank / nuvigator

A powerful routing abstraction over Flutter Navigator, with nested Navigator and Deeplinks
Apache License 2.0
275 stars 33 forks source link

Documentation Improvement #19

Closed leoiacovini closed 4 years ago

brianegan commented 4 years ago

Woohoo! Great job :) This was much easier to use to get started -- a great improvement overall.

I've just gone through my experiment again using the new docs and took these notes, please let me know if I can provide any more info!

Navigator Documentation Walkthrough

Getting started

Route Argument/Parameters

More code questions

leoiacovini commented 4 years ago

Hey @brianegan, tks again for the feedback, we are reflecting upon your feedback and planning to make some changes to make things more explicit and idiomatic :). As soon as we have something I will let you know, just wanted to write an answer here before.

Just to get some inputs: We thought about doing something with extensions but nothing too different came to our minds... (because we would need to add static methods, and I guess extensions do not support it right now). Do you have something different in mind? The furthest I could think of was:

I have not tested it, so I may have missed something haha.

brianegan commented 4 years ago

Nah I think you're exactly right when it comes to mixins / extension methods -- after making that note I actually tried a quick experiment using both, but ran into the same problem: ya need static methods!

Overall, my goal was to see if I could reduce the number of generated classes to simplify things.

leoiacovini commented 4 years ago

Hey @brianegan, I did some changes to the overall library API based on your feedback, my goal was mainly to simplify the overall complexity of classes/names/abstraction and reduce it to the essentials, also trying to shape up the expected usage without providing too many options to do the same thing (like you pointed out). I tried to make things more explicit and using the same set of names wherever possible. If you can take a look at the changelog changes here:

https://github.com/nubank/nuvigator/pull/20/files#diff-4ac32a78649ca5bdd8e0ba38b7006a1e I think they make a good summary of the changes.

The example was tided up a bit to make easier to understand what is going on. We are going to update this documentation PR after it. The recommended usage is to rely in the arguments provided by the Router method, or if you wish to get it down in you Widget tree, you still can call the Args*.of(context), other options were removed. We think this makes things more clear and explicit overall and works out as a good separation of concerns. We also merged the Navigation* class with the Router using extension methods, and now, things should be pretty much easier to remember and use.

Let me know if I got your point correctly with those changes =D

brianegan commented 4 years ago

@leoiacovini Oh my, so sorry -- somehow missed that last request / github notification. Just left some comments on the other PR.