Im taking day month and year in 3 Textfields but none of the DateTime property or function is providing the validation.
I have used DateTime.parse(str) to get the date but it adds the remaining months to the year if month field is entered with more then 12 same for days too.
bool isDate(String str) {
try {
DateTime.parse(str);
return true;
} catch (e) {
return false;
}
}
I want if some one enters '20053050' to the string to be false not true. But this functions always return true !!!