我正在使用SfCalender,并希望将另一个参数传递给onTap 的回调
SfCalendar(
dataSource: _getDataSource(snapshot.data.data),
view: CalendarView.month,
showNavigationArrow: true,
monthViewSettings: MonthViewSettings(
showAgenda: true,
agendaStyle: AgendaStyle(
backgroundColor: Colors.transparent,
appointmentTextStyle: TextStyle(
color: Colors.white, fontSize: 13, fontStyle: FontStyle.italic),
dateTextStyle: TextStyle(
color: primaryColor, fontSize: 13, fontStyle: FontStyle.italic),
),
),
controller: _calendarController,
onTap: _openForm(array),
)
_openForm(CalendarTapDetails details) {
//code
}
目前,如果我不将任何参数传递给_openForm,则CalenderDetails细节具有值,但我想将一个数组与CalenderDetails细节一起传递。我该怎么做?
我不知道SfCalendar库(它是封闭源代码(,但我认为你正在尝试这样做:
onTap: (details) => _openForm(details, array);
// ...
_openForm(CalendarTapDetails details, List myArray) {
// code
}