icerockdev / moko-mvvm

Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development

Home Page:https://moko.icerock.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add extention for binding error on TextInputLayout. Android platform

ExNDY opened this issue · comments

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 } }