CalendarInfo constructor Null safety

CalendarInfo(
  1. {required int year,
  2. required int month,
  3. dynamic thisVsync}
)

Implementation

CalendarInfo({required this.year, required this.month, this.thisVsync}) {
  int lastDay = DateTime(year, month + 1, 0).day;
  int firstWeekday = DateTime(year, month, 1).weekday;

  // 비어있는 날짜
  if (firstWeekday != 7) {
    for (var i = 0; i < firstWeekday; i++) {
      dates.add(DateInfo(isSelected: SelectType.empty));
    }
  }

  for (var i = 0; i < lastDay; i++) {
    AnimationController singleSelectedAniCtrl = AnimationController(
        vsync: thisVsync, duration: const Duration(milliseconds: 500));
    Animation<double> singleScaleTransition = Tween<double>(begin: 0, end: 1)
        .animate(CurvedAnimation(
            parent: singleSelectedAniCtrl,
            curve: Curves.easeOutBack,
            reverseCurve: Curves.easeInQuad));
    dates.add(DateInfo(
        date: i + 1,
        weekday: DateTime(year, month, i + 1).weekday,
        isSelected: SelectType.none,
        singleSelectedAniCtrl: singleSelectedAniCtrl,
        singleScaleAnimation: singleScaleTransition));
  }
}