iamvivekkaushik / DatePickerTimelineFlutter

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

Passing date to DatePickerTimeline does not work #3

Closed peazz closed 5 years ago

peazz commented 5 years ago
DateTime _currentSelection = new DateTime.now().add(Duration(days: 2))

DatePickerTimeline(
        _currentSelection,
        dateSize: 20,
        daySize: 10,
        monthSize: 10,
        selectionColor: Colors.grey[200],
        monthColor: Colors.grey[500],
        onDateChange: (date) {
          _selectDate(date);
        },
      )

Selector does not change, it stays on today

peazz commented 5 years ago

Drilling this down further, I can pass a date but the selector is now only changing after a scroll event, any idea how I can progress this forward?

iamvivekkaushik commented 5 years ago

Hi @peazz, thanks for pointing it out. I have fixed the issue with the date not working when passed to the constructor, however, I couldn't find the issue for selector not changing.

peazz commented 5 years ago

Hey,

Thanks for sorting that out, I will get a demo for you of the calendar selection issue. I do have it in a SliverPersistentHead with some hacky code around it, I will do some further testing.

All the best

peazz commented 5 years ago

So I updated the package gave it a test and everything is now fixed. The date selector is now initialising when I open the new page and pass through DateTime _currentSelection = new DateTime.now().add(Duration(days: 2))

Thanks for your help, this is resolved.