updateFourthIndex method Null safety

void updateFourthIndex(
  1. int index
)

Implementation

void updateFourthIndex(int index) {
  this.fourthIndex = index;

  int minHour = _minHourOfCurrentDay();
  var newTime = currentTime.isUtc
      ? DateTime.utc(
          currentTime.year,
          currentTime.month,
          currentTime.day,
          minHour + index,
          currentTime.minute,
          currentTime.second,
        )
      : DateTime(
          currentTime.year,
          currentTime.month,
          currentTime.day,
          minHour + index,
          currentTime.minute,
          currentTime.second,
        );

  _checkTime(newTime);

  int minMinute = _minMinuteOfCurrentHour();
  int minSecond = _minSecondOfCurrentMinute();

  fifthIndex = currentTime.minute - minMinute;
  sixtyIndex = currentTime.second - minSecond;
}