TimePickerModel constructor
TimePickerModel({})
Implementation
TimePickerModel({
DateTime? currentTime,
this.showSeconds = false,
List<String>? formats,
List<bool>? labels,
List<int>? weights,
List<String>? dividers,
}) : assert(weights == null || weights.length == 3),
assert(dividers == null || dividers.length == 2),
assert(labels == null || labels.length == 3),
assert(formats == null || formats.length == 3) {
this.weights = weights ?? [1, 1, showSeconds ? 1 : 0];
this.dividers = dividers ?? [':', showSeconds ? ':' : ''];
this.formats = formats ?? [HH, mm, ss];
this.labels = labels ?? [false, false, false];
_fillHourList();
_fillMinuteList();
_fillSecondList();
this.currentTime = currentTime ?? DateTime.now();
firstIndex = this.currentTime.hour;
secondIndex = this.currentTime.minute;
thirdIndex = this.currentTime.second;
}