Created
April 25, 2022 12:33
-
-
Save GianpaMX/23ff6b7ddbc1650eed7feb7925684a47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
internal fun EditExpenseContent( | |
state: EditState, | |
onEditExpense: ((Expense) -> Unit)? = null, | |
onPayerClicked: ((Payer) -> Unit)? = null, | |
onAddNewPayerClicked: (() -> Unit)? = null, | |
onReceiverCheckedChange: ((Receiver) -> Unit)? = null, | |
onAddNewReceiverClick: (() -> Unit)? = null, | |
) { | |
var title by rememberSaveable { mutableStateOf(state.expense?.title.orEmpty()) } | |
val pagerState = rememberPagerState() | |
val coroutineScope = rememberCoroutineScope() | |
val onBack: () -> Unit = { | |
state.expense?.let { onEditExpense?.invoke(it.copy(title = title)) } | |
} | |
BackHandler(onBack = onBack) | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment