Open subzero911 opened 3 weeks ago
I want to cancel the toast everytime I press the key.
But it works only on the 1st time, next toasts are not cancelled:
https://github.com/ponnamkarthik/FlutterToast/assets/12999702/3fbcd444-7969-45ba-b8c8-68b4614da188
code:
@override void initState() { super.initState(); nameTextController = TextEditingController() ..addListener(() async { if (nameTextController.text.length > 40) { await Fluttertoast.cancel(); Fluttertoast.showToast(msg: 'Max 40 characters').ignore(); } }); }
I want to cancel the toast everytime I press the key.
But it works only on the 1st time, next toasts are not cancelled:
https://github.com/ponnamkarthik/FlutterToast/assets/12999702/3fbcd444-7969-45ba-b8c8-68b4614da188
code: