File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
feature-add/src/main/java/com/hoc/flowmvi/ui/add Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import androidx.compose.foundation.verticalScroll
2020import androidx.compose.material.icons.Icons
2121import androidx.compose.material.icons.filled.ArrowBack
2222import androidx.compose.material.icons.filled.Email
23+ import androidx.compose.material.icons.filled.Error
2324import androidx.compose.material.icons.filled.Person
2425import androidx.compose.material3.ButtonDefaults
2526import androidx.compose.material3.ElevatedButton
@@ -312,6 +313,11 @@ private fun LastNameTextField(
312313 lastNameError?.let {
313314 Text (text = it)
314315 }
316+ },
317+ trailingIcon = {
318+ if (lastNameError != = null ) {
319+ ErrorIcon ()
320+ }
315321 }
316322 )
317323}
@@ -346,6 +352,11 @@ private fun FirstNameTextField(
346352 firstNameError?.let {
347353 Text (text = it)
348354 }
355+ },
356+ trailingIcon = {
357+ if (firstNameError != = null ) {
358+ ErrorIcon ()
359+ }
349360 }
350361 )
351362}
@@ -380,10 +391,24 @@ private fun EmailTextField(
380391 emailError?.let {
381392 Text (text = it)
382393 }
394+ },
395+ trailingIcon = {
396+ if (emailError != = null ) {
397+ ErrorIcon ()
398+ }
383399 }
384400 )
385401}
386402
403+ @Composable
404+ private fun ErrorIcon () {
405+ Icon (
406+ imageVector = Icons .Filled .Error ,
407+ contentDescription = " Error" ,
408+ tint = MaterialTheme .colorScheme.error,
409+ )
410+ }
411+
387412@Preview(
388413 showBackground = true ,
389414 showSystemUi = true ,
You can’t perform that action at this time.
0 commit comments