iamvivekkaushik/DatePickerTimelineFlutter

initialSelectedDate as an optional parameter

Closed this issue · 1 comments

3ace commented

is it possible to change the initialSelectedDate parameter as optional parameter? I would like to display the date picker without any date preselected.

I've tried initialize DatePicker without initialSelectedDate but it produce this following error

The getter 'day' was called on null.
Receiver: null
Tried calling: day

quick view within the code, it seems initialSelectedDate is used to initialize _curDate variable that is being used throughout the code.

also if it really is required, I think it should be marked as @required.

No, initialSelectedDate was supposed to be optional, I must've forgotten to add the validation for null. Thanks for fixing it for me. I'll merge your PR.