Package-level declarations
The consent
package handles user consent screens, ensuring that users agree to the necessary terms and conditions before proceeding. The consent document gets build by a Markdown Text. The text can be provided via an implementation of the ConsentManager
interface. This interface also provides functions to handle the case when the user has consented as well as a consent failure. The Screen can be used anywhere after providing this interface.
Example implementation:
class EngageConsentManager @Inject internal constructor(
private val navigator: Navigator,
private val messageNotifier: MessageNotifier,
) : ConsentManager {
override suspend fun getMarkdownText(): String {
return """
# Consent
The ENGAGE-HF Android Mobile Application will connect to external devices via Bluetooth to record personal health information, including weight, heart rate, and blood pressure.
Your personal information will only be shared with the research team conducting the study.
""".trimIndent()
}
override suspend fun onConsented() {
navigator.navigateTo(AppNavigationEvent.AppScreen(clearBackStack = true))
}
override suspend fun onConsentFailure(error: Throwable) {
messageNotifier.notify(message = "Something went wrong, failed to submit the consent!")
}
}
Content copied to clipboard
Types
Link copied to clipboard
Link copied to clipboard
interface ConsentManager
A interface that needs to be implemented and provided by the app to provide the consent text and handle consent actions.
Link copied to clipboard
Link copied to clipboard
data class ConsentUiState(val firstName: FieldState = FieldState(value = "", error = false), val lastName: FieldState = FieldState(value = "", error = false), val paths: List<Path> = emptyList(), val markdownElements: List<MarkdownElement> = emptyList())
Link copied to clipboard
Link copied to clipboard