mikirinkode / sports_venue_booking_app

A demo of Sport Venue Booking app and my learning of creating beautiful UI Design using Flutter.
21 stars 9 forks source link

Keep state of each page #1

Open thomastthai opened 1 year ago

thomastthai commented 1 year ago

Nice layouts and code structure. One area to consider is keeping some of the widget's state (such as scroll position and selected tab) persistent after the widget's destruction. When the user flips from page to page or leaves the History tab selected and switches to another page, the state should remain the same as how they left it before jumping to the other page. Currently, the scroll position and the tab selection are reset when the pages are revisited.

PageStorageKey is one way to keep a widget's scroll position state persistent. Another option is AutomaticKeepAliveClientMixin. Feel free to let me know if you want the code implemented with PageStorageKey.

mikirinkode commented 1 year ago

thanks for the suggestion, i'll add that