Open qdsfdhvh opened 1 month ago
Hi, I'm using voyager with compose-multiplatform 1.6.11 and I'm having an issue with the dark theme switching, codes like this:
voyager
1.6.11
setContent { var isNight by remember { mutableStateOf(false) } SwitchthemeinnestednavigatorTheme(isNight) { Navigator(HiddenScreen) { Navigator(HiddenScreen) { // ✅ if hide this line Scaffold { innerPadding -> ... } } } } }
implementation(compose.material3) // same with 1.2.1 🚫 // implementation("androidx.compose.material3:material3:1.1.2") // ✅ // implementation("androidx.compose.material3:material3:1.2.0") // 🚫 // implementation("androidx.compose.material3:material3:1.2.1") // 🚫 // implementation("androidx.compose.material3:material3:1.3.0") // 🚫
Nested Navigator will cause the dark theme to not switch, currently, I found two workaround:
remove nested navigator.
downgrade compose-md3 to 1.1.0+.
But I haven't found the real reason yet and need to ask for help.
demo: https://github.com/qdsfdhvh/switch-theme-in-nested-navigator
This may be related to https://github.com/adrielcafe/voyager/issues/486 and https://github.com/adrielcafe/voyager/issues/484, seems like the newest versions of compose partially break nested navigation in voyager.
This is an issue with Compose Multiplatform.
I've opened a workaround PR for Voyager.
Hi, I'm using
voyager
with compose-multiplatform1.6.11
and I'm having an issue with the dark theme switching, codes like this:Nested Navigator will cause the dark theme to not switch, currently, I found two workaround:
remove nested navigator.
downgrade compose-md3 to 1.1.0+.
But I haven't found the real reason yet and need to ask for help.
demo: https://github.com/qdsfdhvh/switch-theme-in-nested-navigator