-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support for badges on the NavbarItem #43
Conversation
Awesome! @bebaoboy I am currently traveling will review it soon. |
Meanwhile, can you please add some tests regarding this change? You can refer to existing tests in test folder for your reference. Let me know if you need any help. |
Sure thing take your time, Good luck with your school project. I won't be able to review it for another two days. I need to prepare for my conference too and be back be on this PR soon. |
I think having a badge parameter in NavbarItem class would be the right approach. |
Perhaps we should also take into consideration that parameters in NavbarItems can be updated in runtime. Edit: I see you have exposed Again Great work! I really appreciate your contribution. |
@bebaoboy I reviewed your PR its kind of lagging on the web when switching to profile tab, need to investigate further. If you run the app on the web it freezes on switching tabs and the app is no longer usable. |
Hello, How do I run the app on the web like you said to test it? That's so strange, even on landscape mode/navigation rail in mobile, it doesnt seem quite lagging. |
Strange, I saw severe lag issue last night and now I can't reproduce it. It seems to work pretty smooth. I think we are good on the performance part as of now. I am reviewing the code will share the feedback soon. |
@bebaoboy I have made some comments can you please review and incorporate them? Thanks |
Help I don't see them, where are your comments ... Please tell me, thank you |
Oops I did not submit the review, Apologies you should see them now. You are welcome to share you thoughts for each of the review, I am not an expert. |
Co-authored-by: Mahesh Jamdade <[email protected]>
Rest looks good to me, Once this is merged I will update the documentation here https://github.com/maheshmnj/docs/tree/main/docs/navbar_router and the readme.md with a small example If you would like you are welcome to contribute to the documentation. |
Great work @bebaoboy. Thank you for contribution! |
This PR implements the badges and dot feature and integrate them to the navbar_router, with minimal codebase changes.
Based on badges packagae of flutter.
Features:
NavbarNotifier.updateBadges(int index, NavbarBadge badge) // new badges
NavbarBadge.copyWith(...)
NavbarNotifier.makeBadgeVisible(int index, bool visible)
-- Setting the attributes in NavbarRouter when you setup your navbar:
final bool hideBadgeOnPageChanged;
-- Setting it manually anywhere:
NavbarNotifier.hideBadgeOnPageChanged = true;
Demo video
Showing random badges/dots on button click (taking from main.dart in example folder)
5355174357608.mp4
List which issues are fixed by this PR. You must list at least one issue.
Reference: #36 and #30
Pre-launch Checklist
///
).flutter test
P.s: This is my first-time fork so if anything's gone wrong please tell me! Thank you, have a good day! @maheshmnj