convertToDuration method

Duration? convertToDuration()

Convert nullable TimeOfDay to Duration since midnight

Implementation

Duration? convertToDuration() {
  if (this != null) {
    return Duration(hours: this!.hour, minutes: this!.minute);
  } else {
    debugPrint("the Duration to convert to DateTime is NULL");
    return null;
  }
}