Flutter Handling Null Value in TextField
I am writing this post for my self reference. I got serious issues when I parse a TextField value to a double or any other data type.
This will throw exception when you clear the TextField.
So I add if condition like this.
Again, this throws error while clearing the TextField.
To avoid this issue, we can add a TextEditingController for the TextField and check whether the field is empty.
Comments
Post a Comment