1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| @Composable fun ModalDrawerLayoutSample() { val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed) val scope = rememberCoroutineScope() ModalDrawer( drawerState = drawerState, drawerContent = { Column { Text(text = "Text in Drawer") Button(onClick = { scope.launch { drawerState.close() } }) { Text(text = "Close Drawer") } } }, content = { Column { Text(text = "Text in Bodycontext") Button(onClick = { scope.launch { drawerState.open() } }) { Text(text = "Open Drawer") } } } ) }
|