👋
【Flutter】TextInput onChange with editting controller listener
Widget build(BuildContext context) {
final controller = useTextEditingController();
void onControllerChange() {
print('OnControllerChange - ${controller.value.text}');
}
useEffect(() {
controller.addListener(onControllerChange);
return () => controller.removeListener(onControllerChange);
}, [controller]);
return TextFormField(
controller: controller,
);
}
Discussion