GIfatahTH / states_rebuilder

a simple yet powerful state management technique for Flutter
494 stars 56 forks source link

Navigator 2 #247

Closed GIfatahTH closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #247 (87cf8f0) into master (2b501bc) will increase coverage by 0.73%. The diff coverage is 92.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #247      +/-   ##
==========================================
+ Coverage   94.81%   95.54%   +0.73%     
==========================================
  Files          71       73       +2     
  Lines        4935     6043    +1108     
==========================================
+ Hits         4679     5774    +1095     
- Misses        256      269      +13     
Impacted Files Coverage Δ
...tes_rebuilder_package/lib/src/basics/injected.dart 95.65% <ø> (ø)
...c/basics/injected_persistance/i_persist_store.dart 0.00% <0.00%> (ø)
...ebuilder_package/lib/src/builders/on_reactive.dart 100.00% <ø> (ø)
...rebuilder_package/lib/src/builders/top_widget.dart 100.00% <ø> (ø)
...er_package/lib/src/extensions/injected_list_x.dart 92.45% <ø> (-0.77%) :arrow_down:
...njected/injected_animation/injected_animation.dart 100.00% <ø> (ø)
.../lib/src/injected/injected_crud/injected_crud.dart 95.65% <ø> (+0.04%) :arrow_up:
.../lib/src/injected/injected_i18n/injected_i18n.dart 94.50% <ø> (-2.09%) :arrow_down:
...njected/injected_scrolling/injected_scrolling.dart 100.00% <ø> (ø)
...ected/injected_text_editing/i_base_form_field.dart 100.00% <ø> (ø)
... and 89 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8a278b6...87cf8f0. Read the comment docs.

amoslai5128 commented 2 years ago

Cool, finally this package comes with Nav 2.0, however, this thing is complex and stuck when working with flutter web (deep linking, nested route)

GIfatahTH commented 2 years ago

Hi @amoslai5128

Could you help me by giving me the code of the example where deep linking and nested routes are not working?

GIfatahTH commented 2 years ago

@amoslai5128 Please take a look at the navigation example gallery and feed me back.

https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation

amoslai5128 commented 2 years ago

Hi @amoslai5128

Could you help me by giving me the code of the example where deep linking and nested routes are not working?

From my case, I think it's easy to be described by drawing you a screen or picture if you don't mind.

@amoslai5128 Please take a look at the navigation example gallery and feed me back.

https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation

OH MY GOD, this is the smartest way to do that!
I think it must have a promotion at medium.

GIfatahTH commented 2 years ago

@amoslai5128

From my case, I think it's easy to be described by drawing you a screen or picture if you don't mind.

Please go ahead.

amoslai5128 commented 2 years ago

@amoslai5128

From my case, I think it's easy to be described by drawing you a screen or picture if you don't mind.

Please go ahead.

@GIfatahTH, here I am, the hardest part for me are:

  1. how to remain in the current route state when a web browser screen change to a tablet or mobile version, even F5 refreshed.
  2. when the menu bar (web) is clicked, only the screen on the right side will rebuild.
  3. more importantly, a user cannot go back after items were checked out and paid.

I don't mind writing this UI in flutter code so that it can be an example to help others.

EDIT: Fixed the wrong screen name on the menu bar. SR_Nav2 drawio (1)

amoslai5128 commented 2 years ago

@amoslai5128 Please take a look at the navigation example gallery and feed me back.

https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation

I found a bug on ex14_return_data when I got into the options page(yep or nope), then I pressed F5 from the browser, the return data lost, after page popped, nothing shows up.

GIfatahTH commented 2 years ago

@amoslai5128

I found a bug on ex14_return_data when I got into the options page(yep or nope), then I pressed F5 from the browser, the return data lost, after page popped, nothing shows up.

I think that the expected behavior. I tried it with Flutter api and got the same behavior. This is because the (yep or nope) page when F5 is pressed is no longer create from the onPressed callback where we wait for the result.

GIfatahTH commented 2 years ago

Hi @amoslai5128 This is my first attempt to reproduce your use case:

https://github.com/GIfatahTH/ex_navigation_amosali

I concentrated on navigation logic rather than the UI.

GIfatahTH commented 2 years ago

@amoslai5128 Do you have any issue?

Please see the https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation I updated it.

amoslai5128 commented 2 years ago

@amoslai5128 Do you have any issue?

Please see the https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation I updated it.

Oh my god, that's another level of development experience with Navigation 2.0

GIfatahTH commented 2 years ago

@amoslai5128 Can you do me a favor? If you could modify the read me file of the navigation example by adding the list of the examples link with short description of each one.

amoslai5128 commented 2 years ago

@amoslai5128 Can you do me a favor? If you could modify the read me file of the navigation example by adding the list of the examples link with short description of each one.

Ok, I try to work on that asap

amoslai5128 commented 2 years ago

@amoslai5128 Can you do me a favor? If you could modify the read me file of the navigation example by adding the list of the examples link with short description of each one.

@GIfatahTH I've posted a new readme (unfinished), please check it out, let me know if there's any problem.

https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex_006_5_navigation

GIfatahTH commented 2 years ago

@amoslai5128

@GIfatahTH I've posted a new readme (unfinished), please check it out, let me know if there's any problem.

Very good work. I really appreciate your contribution. Please go ahead.

Inspired for what I did with nav2 examples. I started creating a set of example catalog going from basic to advanced for all states_rebuilder features.

I let you know asap.

GIfatahTH commented 2 years ago

@amoslai5128 Here is the first set of examples https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex001_00_sync_global_and_local_state

amoslai5128 commented 2 years ago

@amoslai5128 Here is the first set of examples https://github.com/GIfatahTH/states_rebuilder/tree/dev/examples/ex001_00_sync_global_and_local_state

The content looks clean and organized, great work.

amoslai5128 commented 2 years ago

@GIfatahTH I've finished the first stage of Nav2 README, feel free to take a look.

Please be noticed that some indexes can be more consistent (two ex02 & ex15), and is it a good idea for naming the file title to be intention-driven? such as ex09_on_navigate_signin.dart to be 09: authentication_navigation_guard.dart, therefore, new-starters in VSCode or Finder can understand the use case of that file.

Also, I think some examples below can be reordered, for less confusing I use the names from README as the representative:

It's all my opinions, though I might not get the corresponding meaning by that file, any gride or advice is wonderful.

amoslai5128 commented 2 years ago

And also, is it necessary to move the assets to another GitHub project and use the links, in order to reduce the package size?

GIfatahTH commented 2 years ago

Hi @amoslai5128. Good work :clap:

I am almost ready to push the next update.

Similar to what we did with navigation, I added to example sets; one for sync state mutation and the other for async state mutation. They cover the concept of states_rebuilder from basic to advanced.

I account on you to revise them and update their read me, as you did with navigation examples. I really care to see what you understand of them as a permanent user of states_rebuilder.

Also notice that I add an example to navigation examples. It examples 15 for providing InheritedWidget to pushed routes.

amoslai5128 commented 2 years ago

@GIfatahTH I finished the review of Example 001, please take a look at Readme

However, I'm not sure the section. About the title of DO & DO NOT, since I don't familiar with the Set of independent states of the same type living in stacked routes:. You may want to name a better title right there.

GIfatahTH commented 2 years ago

@amoslai5128 Thank you very much. You are doing a good job.

I worked hard in coding and when it comes to the documentation I was very exhausted so I did it lazily.

You are helping me a lot.