How do I validate for a empty phone number field in a form in flutter without using any extra packages or dependencies?
The easiest way is to check the conditions before printing/returning the values. Check for the following conditions before printing/returning the values. Pass the following conditions in the onPressed.
if(value == null || value.length <10)
print('Enter valid input');
else
print(value);