InputImage

fun <T> InputImage(title: String, state: InputShellState = InputShellState.UNFOCUSED, inputStyle: InputStyle = InputStyle.DataInputStyle(), supportingText: List<SupportingTextData>? = null, legendData: LegendData? = null, uploadState: UploadState = UploadState.ADD, addImageBtnText: String = provideStringResource("add_image"), downloadButtonVisible: Boolean = true, isRequired: Boolean = false, load: suspend () -> T, painterFor: @Composable (T) -> Painter? = null, modifier: Modifier = Modifier, onDownloadButtonClick: () -> Unit, onShareButtonClick: () -> Unit, onResetButtonClicked: () -> Unit, onAddButtonClicked: () -> Unit)

DHIS2 Input image. Wraps DHIS · BasicInputImage.

Parameters

title

: controls the text to be shown for the title.

state

: Manages the InputShell state.

inputStyle

: manages the InputShell style.

supportingText

: is a list of SupportingTextData that manages all the messages to be shown.

legendData

: manages the legendComponent.

uploadState

: controls whether the image is added, loading, or need to be added.

addImageBtnText

: controls the text to be shown for the add image button.

downloadButtonVisible

: controls whether the download button is visible or not.

isRequired

: controls whether the field is mandatory or not.

load

: to load an image stored in the resource, device memory or from network, we can use loadPainter, loadImageBitmap, loadSvgPainter or loadXmlImageVector.

painterFor

: is a composable function which controls how to paint the load param.

modifier

: allows a modifier to be passed externally.

onDownloadButtonClick

: callback to when download button is clicked.

onShareButtonClick

: callback to when share button is clicked.

onResetButtonClicked

: callback to when reset button is clicked.

onAddButtonClicked

: callback to when add button is clicked.