RequireNfc

fun RequireNfc(onChanged: (Boolean) -> Unit = {}, contentWithoutNfc: @Composable (NfcNotAvailableReason) -> Unit = { NoNfcView(reason = it) }, content: @Composable () -> Unit)

A wrapper for composables that require Bluetooth.

Example:

RequireNfc(
onChange = { enabled ->
//..
},
contentWithoutNfc = { reason ->
Text("NFC is not available: $reason")
},
) {
Text("NFC is available")
}

Parameters

onChanged

A callback that will be called when the state of the NFC changes.

contentWithoutNfc

A composable that will be displayed when NFC is not available.

content

A composable that will be displayed when NFC is available.