form_bloc
form_bloc copied to clipboard
Listening on SwitchFieldBlocBuilder changes
Hi,
I can get OnTap or OnChanged and many others on TextFieldBlocBuilder, but nothing is available for SwitchFieldBlocBuilder to listen if the switch was pressed.
I tried wrapping into a GestureDetector but the switch press does not fire its events, only pressing on the label works. Not very useful.
Hi, I include it later, what are you trying to do? for now you can listen to the field bloc
formBloc.booleanField.onValueChanges(
onData: (previous, current) async* {
if (current.value) {
// ,,,
} else {
//...
}
},
);
Show an additional TextFieldBlocBuilder after activating the switch.
Something really simple like this.
I guess i can use a normal switch and fetch the value later during OnSubmitting, but i was wondering why at least OnChanged was not present in the SwitchFieldBlocBuilder.
hi ,this is my issue, can you help?