So this is what I want basicly:
I want every day to be and index so 2020 jan. is 31 days + feb. 21 = 52
. When I click on feb 21 I want to jump to page with index 52. Right now Its jump to 52 because of this code:
controller.jumpToPage(52);
You can use DateTime.difference()
:
final firstDate = DateTime(2020, 1, 1);
final secondDate = DateTime(2020, 2, 21);
final index = secondDate.difference(firstDate).inDays;
controller.jumpToPage(index) // index : 51