0

我使用 syncfusion_flutter_calendar 创建了一个日历,我想在用户选择月份时获取月份编号,当用户在变量中选择日期时,这里是日历代码

SfCalendar(
            view: CalendarView.month,
            monthCellBuilder:
                (BuildContext buildContext, MonthCellDetails details) {
             
              final Color defaultColor =
                  Theme.of(context).brightness == Brightness.dark
                      ? Colors.black54
                      : Colors.white;
              return Container(
                decoration: BoxDecoration(
                    color: Colors.red,
                    border: Border.all(color: defaultColor, width: 0.5)),
                child: Center(
                  child: Text(
                    details.date.day.toString(),
                    style: TextStyle(color:Colors.blue),
                  ),
                ),
              );
            },
            showDatePickerButton: true,
            monthViewSettings: MonthViewSettings(
              showTrailingAndLeadingDates: false,
            )));
  
            
  }
  

我必须在我的 api 中使用这些值,请帮助,如何做到这一点。

4

0 回答 0