add parameter for function to get selected date
This commit is contained in:
parent
8d003c0bef
commit
901e29b348
1 changed files with 3 additions and 0 deletions
|
|
@ -5,10 +5,12 @@ import 'package:table_calendar/table_calendar.dart';
|
||||||
class MIHCalendar extends StatefulWidget {
|
class MIHCalendar extends StatefulWidget {
|
||||||
final double calendarWidth;
|
final double calendarWidth;
|
||||||
final double rowHeight;
|
final double rowHeight;
|
||||||
|
final void Function(String) setDate;
|
||||||
const MIHCalendar({
|
const MIHCalendar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.calendarWidth,
|
required this.calendarWidth,
|
||||||
required this.rowHeight,
|
required this.rowHeight,
|
||||||
|
required this.setDate,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -23,6 +25,7 @@ class _MIHCalendarState extends State<MIHCalendar> {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedDay = day;
|
selectedDay = day;
|
||||||
});
|
});
|
||||||
|
widget.setDate(selectedDay.toString().split(" ")[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue