如何解决月份不更改table_calendar
需要一些帮助。我从该库table_calendar创建了日历,但是我在执行任务时遇到了一些麻烦。我需要日历的其他标题,因此我禁用了标题并创建了自定义标题。但是,有一个问题:当我单击按钮时,月份在改变,但是当我滑动日历月份时却没有改变。我试图找到那里的滑动控制器或其他东西来创建自定义滑动,但是找不到任何东西。请帮助,这是自定义标头的代码:
Widget _buildHeader() {
return Container(
height: weekFormat ? 0 : 54,child: Row(
children: [
InkWell(
child: Container(
padding: EdgeInsets.fromLTRB(14,13,16),child: Text(calendarController.focusedDay == null
? ""
: dateFormat.format(calendarController.focusedDay).toString()
+ "," +
calendarController.focusedDay.year.toString()
),),onTap: () {
setState(() {
calendarController.toggleCalendarFormat();
weekFormat = true;
});
},SizedBox(width: 100),InkWell(
child: Container(
height: 20,width: 20,color: Colors.black,onTap: () {
setState(() {
calendarController.setFocusedDay(DateTime(
calendarController.focusedDay.year,calendarController.focusedDay.month - 1));
});
},SizedBox(width: 20),calendarController.focusedDay.month + 1));
});
},],);
如果有任何方法可以更改滑动,请告诉我
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。