title: How to check whether the entered Date in Textfield is valid or not in Dart/Flutter?
body: <p>Im taking day month and year in 3 Textfields but none of the DateTime property or function is providing the validation.</p>
  
  <p>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.</p>
  
  <pre><code>bool isDate(String str) {
    try {
      DateTime.parse(str);
      return true;
    } catch (e) {
      return false;
    }
  }
  </code></pre>
  
  <p><em>I want if some one enters '20053050' to the string to be false not true.
  But this functions always return true !!!</em></p>
  
  <p><a href="https://i.stack.imgur.com/TL6yt.jpg" rel="noreferrer">enter image description here</a></p>