-
Notifications
You must be signed in to change notification settings - Fork 5
Fix app layout #1095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Fix app layout #1095
Conversation
|
||
int currentTabIndex = globals.tabController.index; | ||
|
||
// Return app bar actions based on current tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The hard coded numbers make this code hard to maintain. If the router order changes, this will break. Maybe we can use named constants or a configuration map instead.
When i tested the app, its the same flow. I don't get What specific issue does this solve ? |
As mentioned in the attached issue, the code is the same. I just changed the app layout to be dynamic instead of fixed in every screen. Notice the bottom nav with every new navigation, it's not reloaded anymore. |
State<AppLayout> createState() => _AppLayoutState(); | ||
} | ||
|
||
class _AppLayoutState extends State<AppLayout> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I suggest creating simple data class to hold icon, label and index for each navigation entry to be used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…stead of page number in home screen & home card
… router is initialized and cache nav entries
Changes
Add app layout, merge registered screen & home, remove layout drawer
Related Issues
Tested Scenarios
Navigate to all screens back and forth