Comments (3)
Hi, @tushar4303, Thanks for filing the issue. I think this is the same issue as #6 I need to reinvestigate how fade transition works. Meanwhile please follow up on that issue, I know it has been quite a while since it hasn't been solved. I will try my best to solve it within a week.
Closing as duplicate of the linked issue. Incase you disagree, please feel free to write in the comments and I would be happy to rereview.
from navbar_router.
Certainly! Here's a reply you can use:
Hi @maheshmnj ,
Thank you for your prompt response and for linking the related issue #6. I'll keep an eye on that to stay updated on the progress.
In the meantime, I'll explore using the AnimatedSwitcher as suggested in the mentioned issue. Additionally, I have a question regarding implementing a feature in v0.3.3. I'm using four main pages as the base route, and subpages inside them are pushed using navigator.pushNamed. I want the back button behavior to navigate back to the home page when pressed on any of the four pages (similar to Instagram), and on a double tap on the home page, I should exit the app.
I tried the code from the documentation, but it didn't work as expected. Could you please provide guidance or share a code snippet for achieving this behavior?
Thanks again for your assistance!
from navbar_router.
@tushar4303 to pop to base route from a deeply nested route from any tab you just have to pass shouldPopToBaseRoute: true
to navbar_router (true by default) so you don't have to explicitly do anything to achieve that behavior.
for handling the double press backbutton to exit you have to implement your custom logic in onBackButtonPressed
onBackButtonPressed: A function which defines whether it is the root Navigator or not. if the method returns true then the Navigator is at the base of the navigator stack
Heres the implementation from the example app
DateTime oldTime = DateTime.now();
DateTime newTime = DateTime.now();
onBackButtonPressed: (isExitingApp) {
if (isExitingApp) {
newTime = DateTime.now();
// time difference between consecutive taps
int difference = newTime.difference(oldTime).inMilliseconds;
oldTime = newTime;
if (difference < 1000) {
NavbarNotifier.hideSnackBar(context);
return isExitingApp;
} else {
final state = Scaffold.of(context);
NavbarNotifier.showSnackBar(
context,
"Tap back button again to exit",
bottom: state.hasFloatingActionButton ? 0 : kNavbarHeight,
);
return false;
}
} else {
return isExitingApp;
}
},
You can see both of those features in action by running the example app. Let me know if any of that doesn't work as intended.
from navbar_router.
Related Issues (20)
- Navbar Height is too much on Android and IOS HOT 5
- NotchedNavbar throws Null check operator used on Null Value HOT 1
- NotchedNavbar shape has material surface which shows incorrect shape HOT 1
- Use type `Widget` instead of `IconData` for class `NavbarItem` HOT 2
- Stacking a widget on top of an existing navigation stack with the wrong navbar item highlighted HOT 6
- [Proposal] Improve the docs HOT 3
- Support for custom NavigationBar HOT 1
- Refactor NavbarNotifier apis HOT 1
- Support for badges on the NavbarItem HOT 6
- Add support for Snackbar over the Navbar to show error/warning
- NavbarNotifier should have a listener for route change.
- Showcase your beautiful app on Navbar Router docs HOT 3
- didUpdateWidget() does not take into account changes in navbar items HOT 10
- Snackbar does not show up in example app HOT 2
- Update new NavigationRail APIs HOT 2
- Add horizontal Swipe gesture to change tabs HOT 7
- [Proposal]Expose minWidth and minExtendedWidth from NavigationRail to NavbarRouter HOT 5
- Improve the Demo app HOT 1
- WillPopScope' is deprecated and shouldn't be used. Use PopScope instead. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from navbar_router.