Type safe, multi-module best practices with Navigation Compose
了解使用 Navigation Compose 的最佳实践,以便您能以可在所有导航调用中维持类型安全的方式,在多个模块中展开导航图。
1. Define your screen as state in,events out

你的屏幕不应该在意你的数据是来自视图模型,还是只是你为单个测试创建的静态状态。它也不应该关心接收事件的对象是谁。
2. Split up your navigation graph


3. Build only the public APIs you need





4. Module structure -> Graph structure



5. Check out the Updated resources
Kotlin DSL 和 Navigation Compose 中的类型安全
NowInAndroid app: github.com/android/now...