I NEED your help :
the issue where the TextField color is not updating until you press a button or write some text in another TextField
I have this viewmodel and I am using https://github.com/rickclephas/KMP-NativeCoroutines ,
@MainActor
class PersonalInfoViewModelViewModel: ObservableObject {
let viewModelKt = DIHelper().providePersonalInfoViewModel
@Published private(set) var uiState = PersonalInfoViewModelContractMyUiState.companion.defaultInstance()
init() {
Task {
do {
let uiStateFlow = asyncSequence(for: self.viewModelKt.uiStateNativeFlow)
for try await state in uiStateFlow {
self.uiState = state as! PersonalInfoViewModelContractMyUiState
}
}
struct TextFieldN: View {
var text: String
var isValid: Bool
var onTextChange: (String) -> Void
var body: some View {
var bind: Binding<String> = Binding(get: { text }, set: { value in
onTextChange(value)
})
VStack(alignment: .leading) {
TextField("", text: bind)
.foregroundColor(isValid ? Neutral50 : Red)
}
}
}
I NEED your help : the issue where the TextField color is not updating until you press a button or write some text in another TextField I have this viewmodel and I am using https://github.com/rickclephas/KMP-NativeCoroutines ,