Comments (4)
It works, but when we have more than 40 Destination, it's starting to become difficult to maintain
You can just do
dependency(OpenFullScreen { openFullScreen.invoke() })
And that will make it available to any destination in this DestinationsNavHost, even if you have a thousand. I also like how you're just passing a specific functionality you need rather than passing a whole NavController. I would go with that if possible.
I see the idea with the registry, but I would personally avoid doing this as much as possible, unless it's the only way. But if you have it and it works for you, nothing against it either :)
from compose-destinations.
We're using CompositionLocalProvider
to obtain the instance of root DestinationsNavigator
.
from compose-destinations.
Yes nice idea, I donβt think about using CompositionLocalProvider enough.
But I think I prefer in this case, to create another DestinationsNavigator and inject it with the dependency builder.
To have it directly in the destination arguments
from compose-destinations.
Hi π
Yes ok I see, I know that the interface is available in all destination, we can continue to use the dependency but be more smart, I will make an interface to navigate to all full screen destination
fun interface OpenFullScreen {
fun invoke(destination: Destination)
}
I agree with you, I am not fan to pass whole NavController
Thanks for your feed back :)
from compose-destinations.
Related Issues (20)
- [Question]where to call navigate, which one is the best practices HOT 6
- KMP support HOT 4
- Bottom bar navigation documention that says to do `currentDestination == destination.direction` in selected doesn't select the element HOT 3
- [Question] How to enable / disable animation based on destination value HOT 4
- Feature request: Allow generation of SavedStateHandle from NavArgs for testing HOT 3
- Feature request: Result recipient lambda with default implementation HOT 3
- Saving history of stacks on nested navigation without multiple nav host. HOT 1
- Multiple result recipients no longer supported in 1.9.57 HOT 14
- Status of v2.0.0-alpha branch? HOT 1
- Default values in multiple lines don't work HOT 25
- Is there an equivalent of Destination.invoke for deeplinks? HOT 2
- Item selection doesn't work in Bottom Sheet HOT 9
- After updating some Gradle libraries including this one I get "BackendException: Backend Internal error: Exception during psi2ir" on a RootNavGraphDefaultAnimations implementation HOT 8
- Error: NavArgsGettersKt.dex defined mutiple times HOT 3
- Document Navigation.Extras HOT 3
- ModalBottomSheetLayout UI content no longer visible after system font size change until app restarted HOT 1
- NavArgsDelegate fails KSP due to false positive when property code comments include parentheses HOT 3
- the topbar is not displaying properly. HOT 1
- the topbar is not displaying properly.
- PopBackStack does not have a check for lifecycle state like navigate does 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 compose-destinations.