iamvivekkaushik / DatePickerTimelineFlutter

Flutter Date Picker Library that provides a calendar as a horizontal timeline
Apache License 2.0
283 stars 198 forks source link

initialSelectedDate as an optional parameter #31

Closed 3ace closed 4 years ago

3ace commented 4 years ago

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.

iamvivekkaushik commented 4 years ago

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.