MonthlyCalendar constructor

MonthlyCalendar({
  1. Key? key,
  2. required DateTime startDateTime,
  3. required DateTime endDateTime,
  4. bool shortHeader = true,
  5. DateTime? selectedDateTime,
  6. MonthlyCalendarLocale locale = const EnglishMonthlyCalendarLocale(),
  7. ValueChanged<DateTime>? onMonthChanged,
  8. ValueChanged<DateTime>? onSelectedDateChanged,
  9. int firstWeekday = DateTime.monday,
  10. Duration pageViewAnimationDuration = const Duration(milliseconds: 200),
  11. Curve pageViewAnimationCurve = Curves.fastOutSlowIn,
  12. double pageViewEstimateHeight = 350,
  13. ScrollPhysics scrollPhysics = const PageScrollPhysics(),
  14. Clip clipBehavior = Clip.hardEdge,
  15. String? restorationId,
  16. MonthlyCalendarThemeData? theme,
  17. dynamic onCellLongPress(
    1. DateTime datetime
    )?,
  18. MonthlyCalendarController? controller,
})

Implementation

MonthlyCalendar({
  Key? key,
  required this.startDateTime,
  required this.endDateTime,
  this.shortHeader = true,
  this.selectedDateTime,
  this.locale = const EnglishMonthlyCalendarLocale(),
  this.onMonthChanged,
  this.onSelectedDateChanged,
  this.firstWeekday = DateTime.monday,
  this.pageViewAnimationDuration = const Duration(milliseconds: 200),
  this.pageViewAnimationCurve = Curves.fastOutSlowIn,
  this.pageViewEstimateHeight = 350,
  this.scrollPhysics = const PageScrollPhysics(),
  this.clipBehavior = Clip.hardEdge,
  this.restorationId,
  this.theme,
  this.onCellLongPress,
  this.controller,
})  : assert(
        firstWeekday == DateTime.monday ||
            firstWeekday == DateTime.sunday ||
            firstWeekday == DateTime.saturday,
        "MonthlyCalendar support only Monday, Sunday, Saturday",
      ),
      assert(startDateTime.isBefore(endDateTime)),
      super(key: key);