简体   繁体   English

如何在table_calendar包flutter中获取当前显示的月份

[英]How to get current displayed month in table_calendar package flutter

I'm building a calendar using the table_calendar flutter package.我正在使用 table_calendar flutter 包构建日历。 Other all things are done now just I want to get currently selected month from the calendar.其他所有事情现在都完成了,只是我想从日历中获取当前选定的月份。 I try to find out the way and try all the events but did not get success yet.我试图找出方法并尝试所有事件,但尚未成功。 Anyone have a solution, help me a lot.任何人都有解决方案,帮助我很多。

Package Link: https://pub.dev/packages/table_calendar包链接: https : //pub.dev/packages/table_calendar

Looking at https://pub.flutter-io.cn/documentation/table_calendar/latest/table_calendar/CalendarController-class.htmlhttps://pub.flutter-io.cn/documentation/table_calendar/latest/table_calendar/CalendarController-class.html

You should be able to get the current month by using focusedDay on the CalendarController.您应该能够通过在 CalendarController 上使用focusedDay来获取当前月份。

focusedDay → DateTime
Currently focused day (used to determine which year/month should be visible).
read-only

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM