https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Suresh Maidaragi

11/07/2023, 2:22 AM
Hi there, I am using
precompose
for navigation, we have bottomBarNavigation in the screen, as shown below
Copy code
@Composable
fun Navigation(navigator: Navigator, viewModel: DashboardViewModel) {
    NavHost(navigator = navigator, initialRoute = NavigationItem.Dashboard.route) {

        scene(NavigationItem.Dashboard.route) {
            DashboardScreen({}, {})
        }

        scene(NavigationItem.Channel.route) {
            ChannelScreen()
        }

        scene(NavigationItem.Video.route) {
            VideoScreen()
        }

    }
}
When we tap between any tabs multiple times, clicked tabs getting added to stack, when we click hardware back button on android app, all tabs popbacks, Is there way to maintain only 1 instance of tab in stack?
k

khalid64927

11/07/2023, 5:45 AM
Block any action coming in less than a second in that lambda
s

Suresh Maidaragi

11/08/2023, 10:50 AM
ho that is hacky way, there is option in compose itself
Copy code
NavOptions(launchSingleTop = true)
helped me
7 Views