setControllers method

void setControllers()

Implementation

void setControllers() {
  /// 初始化Index
  yearIndex = initialTime.year - data[0][0];
  monthIndex = initialTime.month - data[1][0];
  dayIndex = initialTime.day - data[2][0];
  weekDayIndex = initialTime.weekday - 1;

  controllers = [
    FixedExtentScrollController(initialItem: yearIndex),
    FixedExtentScrollController(initialItem: monthIndex),
    FixedExtentScrollController(initialItem: dayIndex),
    FixedExtentScrollController(initialItem: weekDayIndex),
    FixedExtentScrollController(initialItem: initialTime.hour),
    FixedExtentScrollController(initialItem: initialTime.minute),
    FixedExtentScrollController(initialItem: initialTime.second)
  ];
  yearFixedExtentScrollController = controllers[0];
  monthFixedExtentScrollController = controllers[1];
  dayFixedExtentScrollController = controllers[2];
  weekDayFixedExtentScrollController = controllers[3];
  hourFixedExtentScrollController = controllers[4];
  minuteFixedExtentScrollController = controllers[5];
  secondFixedExtentScrollController = controllers[6];
}