Skip to content

JumpToSelection() offset has issues. #29

@amith-patil

Description

@amith-patil

Describe the bug

the JumpToSelection() function takes the time into consideration causing offset values to change during different times.

To Reproduce

Create a startDate to be of the format "YYYY-MM-DD 00:00:00"
select initialSelectedDate as DateTime.now()
over the course of the day, on calling the JumpToSelection() for the first time via a separate button, the timeline will jump from to the date +1 value ( ex: if today is may 11th, JumpToSelection() will jump to May 12th after a period of the day has passed)

Expected behavior

A clear and concise description of what you expected to happen.
on initial jump, the timeline should jump to the initialSelectedDate Value

Screenshots

If applicable, add screenshots to help explain your problem.

ezgif-3-d1001ca39879

also, this weird thing happens, I'm not sure why :

ezgif-3-3c6cb3f8f3af

Additional context
Add any other context about the problem here.

code used by me :

 DateTime _selectedDate = DateTime.now(); . . . DatePickerController _dpc = new DatePickerController(); . . . DatePicker( _startDate, controller: _dpc, initialSelectedDate: _selectedDate, width: Size_Config.blockSizeHorizontal * 15, height: Size_Config.blockSizeVertical * 12, monthTextStyle: TextStyle( fontFamily: 'Montserrat', color: Colors.white54, fontSize: Size_Config.blockSizeHorizontal * 3), dateTextStyle: TextStyle( fontFamily: 'MontSerrat', fontSize: Size_Config.blockSizeHorizontal * 5, fontWeight: FontWeight.bold, color: Colors.white54), dayTextStyle: TextStyle( fontFamily: 'Montserrat', color: Colors.white54, fontSize: Size_Config.blockSizeHorizontal * 3), onDateChange: (date) { _pc.open(); setState(() { _selectedDate = date; }); }, ), . . . IconButton( onPressed: () { _dpc.animateToSelection(); }, icon: Icon(CustomIcons.filter), color: Colors.white54, //iconSize: 40, ), 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions