isValid is optional and by default true

This commit is contained in:
Lukas Barragan Torres 2023-05-13 15:36:04 +02:00
parent b4166386a5
commit a328d2194f
2 changed files with 2 additions and 1 deletions

View file

@ -117,7 +117,7 @@ fun LabeledErrorTextField(
initialValue: String,
@StringRes label: Int,
singleLine: Boolean = false,
isValid: MutableState<Boolean>,
isValid: MutableState<Boolean> = remember { mutableStateOf(true) },
isFirst: MutableState<Boolean> = remember { mutableStateOf(false) },
@StringRes errorText: Int,
keyboardType: KeyboardType,

View file

@ -30,6 +30,7 @@ class BreakTimerFormScreen(
initialValue = breakTimerInfo.repeats.toString(),
label = R.string.repeats,
errorText = AppText.repeats_error,
isValid = mutableStateOf(false),
keyboardType = KeyboardType.Decimal,
predicate = { it.matches(Regex("[1-9]+\\d*")) }
) { correctlyTypedInt ->