Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Created August 22, 2021 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Skyyo/11fd8d1d6e9394d83d571aef556b8f2a to your computer and use it in GitHub Desktop.
Save Skyyo/11fd8d1d6e9394d83d571aef556b8f2a to your computer and use it in GitHub Desktop.
@Composable
fun CustomTextField(
inputWrapper: InputWrapper,
onValueChange: OnValueChange,
onImeKeyAction: OnImeKeyAction
) {
Column {
TextField(
value = inputWrapper.value,
onValueChange = { onValueChange(it) },
isError = inputWrapper.errorId != null,
keyboardActions = KeyboardActions(onAny = { onImeKeyAction() }),
)
if (inputWrapper.errorId != null) {
Text() // error message
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment