Closed Ranko97 closed 3 years ago
Hello @Ranko97,
What do you think of the following behaviour:
If the current date (datetime.now) is included in the firstDate - lastDate range, it is used as default. Otherwise, we use the lastDate.
Good for you?
Hello @GaspardMerten ,
Yes, I think that should solve this issue.
This is now a solved issue in the latest version (2.1.2)
The new argument is called initialDate.
Thank you for reporting the issue.
When I have
lastDate
provided (e.g. user should have 18 years),initialDateTime
would be set toDateTime.now()
, which causes errors. Current workaround is to provide initialDate in correct range, but this means date field would be preselected.This issue can be solved by changing the default initial date value from
DateTime.now()
tolastDate
.So, this would be the correct code:
final DateTime initialDateTime = selectedDate ?? lastDate;
, on line 86, function_selectDate
, in filefield.dart
.From my limited testing, this would not cause any additional issues.
If there is another way to solve this issue, please let me know.