Comments (8)
@skybur finally fixed in auto_route_generator 0.4.10 Thanks @nateshmbhat
from auto_route_library.
@skybur I'll look into it. Are you sure it's a good idea to pass a callback func to a route though?
from auto_route_library.
Well, one of my use case is like this
- I have Screen A with list of items loaded from network and cached.
- I click an item to navigate to Screen B which is the item detail screen.
- There I can update the item properties without popping the detail screen
- I want to refresh the Screen A's item list (some of the properties are displayed there) so I provided the callback to Screen B to call when the item changed
I can't think any other way besides providing callback.
from auto_route_library.
@skybur You could have a shared model/bloc between your master/details screens or if you're going for a simpler approach you could have your DetailsScreenRoute return the edited ITEM then update your list from there
var editedItem = await Router.navigator.push(Router.detailsScreen);
// inside of your details screen pop with Results
Router.navigator.pop([editedItem]);
from auto_route_library.
I tried using Navigator.pop
to pass back value, but I don't quite like it, because I think it's not descriptive enough about what will be returned. I mean I need to see inside the class that calls Navigator.pop
to know what will be returned. On the other hand if I used callback to return the value, I know what will be returned. That's just me though and maybe that's not a good practice.
However I'm gonna try your suggestion since I'm totally gonna use this package for routing, thanks!
from auto_route_library.
@skybur, You can easily type your returned results
@MaterialRoute(returnType: ITEMTYPE)
DetailsScreen detialsScreen;
....
Router.navigator.pushNamed<ITEMTYPE>()
Router.navigator.pop<ITEMTYPE>(item)
I hope this helps. and thanks for reporting the bug, I'll let you know when it's fixed.
from auto_route_library.
I'm wondering what that returnType
is used for. So that's how I use it!
I think that improves the descriptiveness when using Navigator.pop
since I can just see in the router class what will be returned. Thanks again!
from auto_route_library.
@skybur You're welcome.
from auto_route_library.
Related Issues (20)
- Write Widget Test with AutoTabsScaffold HOT 1
- AutoTabsRouter's bottomNavigationBuilder is being built twice when there are more than 2 routes specified
- pop/push detection with AutoRouteObserver and navigateTo HOT 5
- reevaluateListenable Work only once HOT 13
- Deferred only for web
- pushNamed with object(s)
- Click returns to home page when ad impression occurs
- Navigation history lost when resizing in responsive design HOT 4
- How to return to single route from nested routes? (with back) HOT 2
- Cannot decipher customRouteBuilder documentation HOT 1
- When an app is terminated. DeepLink (Universe Link IOS) only navigate to the '/' root without a specific route is used
- Race condition with guards when using router.pop() while reevaluating
- AutoTabsRouter.pageView display wrong page when remove a page from pageview
- How to look up PageRouteInfo by name? HOT 1
- Back button on Android always closes the app HOT 1
- AutoTabsRouter pop issue
- Nested TabBar Navigation not Working as Expected HOT 2
- Changing build configuration generated file locations
- [BUG] Dialog in AutoRoute by using CustomRoute is not working HOT 1
- Path/Query parameter parser
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 auto_route_library.