In my application, I have implemented the daysPageView. I added a showDatePicker widget and i wanted the displayed page to jump to the page which the user selects in the showDatepicker. The widget showDatePicker returns a DateTime variable. But when i tried to call _dayspagecontroller.jumpToDay(), i get this error : The method 'jumpToDay' was called on null. . Could you please help out in modifying the jumpToDay function so that when a DateTime value is returned, The method will jump the page to the selected date in showDatePicker?
The impmentation of jumpToDay in my app :
`
_selectDate() async {
final DateTime picker =await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(2010),
lastDate: DateTime(2040));
In my application, I have implemented the daysPageView. I added a
showDatePicker
widget and i wanted the displayed page to jump to the page which the user selects in theshowDatepicker
. The widgetshowDatePicker
returns aDateTime
variable. But when i tried to call_dayspagecontroller.jumpToDay()
, i get this error :The method 'jumpToDay' was called on null.
. Could you please help out in modifying thejumpToDay
function so that when aDateTime
value is returned, The method will jump the page to the selected date inshowDatePicker
?The impmentation of
jumpToDay
in my app : `_selectDate() async { final DateTime picker =await showDatePicker( context: context, initialDate: DateTime.now(), firstDate: DateTime(2010), lastDate: DateTime(2040));
// await runJump(selectedDate); return selectedDate; } } `
`
new FlatButton(onPressed: () => _daysPageController.jumpToDay(_selectDate()), child: Text("change date"),
`