Frequency.Dynamic constructor Null safety

Frequency.Dynamic(
  1. String pName,
  2. String pInterval,
  3. int pTimesPerInterval
)

dynamic occureance frequency constructor

Implementation

Frequency.Dynamic(String pName, String pInterval, int pTimesPerInterval) {
  this.name = pName;
  this.isOnce = false;

  this.isDynamic = true;
  this.isText = false;
  pInterval == "Day" ? this.timesPerDay = pTimesPerInterval : 0;
  pInterval == "Week" ? this.timesPerWeek = pTimesPerInterval : 0;
  pInterval == "Month" ? this.timesPerMonth = pTimesPerInterval : 0;
  pInterval == "Year" ? this.timesPerYear = pTimesPerInterval : 0;
  this.hoursAtDay = [];
  this.daysAtWeek = [];
  this.daysAtMonth = [];
  this.daysAtYear = [];
}