add parameter for function to get selected date
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user