Daniel Singer
03/01/2023, 2:03 AMModalBottomSheet
example uses invokeOnCompletion
to wait until the bottom sheet is hidden here
Is this materially different than just doing:
scope.launch {
bottomSheetState.hide()
if(!bottomSheetState.isVisible) {
openBottomSheet = false
}
}
since hide()
seems to suspend until it's done anyway?Albert Chang
03/01/2023, 4:29 AMinvokeOnCompletion
is like finally
, which will run even when an exception was thrown or the coroutine was cancelled.Andy Himberger
03/01/2023, 4:52 AMjossiwolf
03/01/2023, 7:37 AMjossiwolf
03/01/2023, 7:38 AMDaniel Singer
03/01/2023, 8:45 PM