Created
September 9, 2021 12:01
-
-
Save lbenevento/0b847580f1e049ffa3a2d908c7736eaa 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 | |
fun TextField( | |
//Parameters omitted | |
) { | |
Column( | |
modifier = modifier | |
) { | |
androidx.compose.material.TextField( | |
//Parameters omitted | |
) | |
Box( | |
modifier = Modifier | |
.requiredHeight(16.dp) // Height as per Material specs | |
.padding(start = 16.dp, end = 12.dp) // Padding as per Material specs | |
) { | |
if (isError) { | |
if (errorMessage != null) { | |
errorMessage() | |
} | |
} else { | |
if (helperMessage != null) { | |
helperMessage() | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment