add parameter for function to get selected date

This commit is contained in:
2024-11-07 11:59:41 +02:00
parent 8d003c0bef
commit 901e29b348

View File

@@ -5,10 +5,12 @@ import 'package:table_calendar/table_calendar.dart';
class MIHCalendar extends StatefulWidget {
final double calendarWidth;
final double rowHeight;
final void Function(String) setDate;
const MIHCalendar({
super.key,
required this.calendarWidth,
required this.rowHeight,
required this.setDate,
});
@override
@@ -23,6 +25,7 @@ class _MIHCalendarState extends State<MIHCalendar> {
setState(() {
selectedDay = day;
});
widget.setDate(selectedDay.toString().split(" ")[0]);
}
@override