icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
995 stars 95 forks source link

Add extention for binding error on TextInputLayout. Android platform #207

Closed ExNDY closed 1 year ago

ExNDY commented 1 year ago

Please add binding for formfield error, for my solution im use this

fun TextInputLayout.bindError( lifecycleOwner: LifecycleOwner, flow: CStateFlow<StringDesc?>, ): DisposableHandle { return flow.bind(lifecycleOwner) { this.error = it?.toString(this.context) this.isErrorEnabled = it != null } }