I would need some more details to give you a better answer.
If you are trying to detect when the user clicks on a date in MonthView, you pass a dayOfMonthBuilder to MonthView. All the click detection should happen in the widget produced by dayOfMonthBuilder.
Your code should look something like this:
// ... somewhere in `Widget build(BuildContext context){`
new MonthView(
month: _month,
dayOfMonthBuilder: _dayOfMonthBuilder,
),
// ...
Widget _dayOfMonthBuilder(BuildContext context, DayOfMonth dayOfMonth) {
return GestureDetector(
onTap: () {
// user clicked on a day of month
},
child: new Container(
child: new Center(
child: new Text("${dayOfMonth.day.day}"),
),
)
);
}
I would need some more details to give you a better answer.
If you are trying to detect when the user clicks on a date in
MonthView
, you pass adayOfMonthBuilder
toMonthView
. All the click detection should happen in the widget produced bydayOfMonthBuilder
.Your code should look something like this: