from static method

DateTime from({
  1. int? year,
  2. int? month,
  3. int? day,
  4. int? hour,
  5. int? minute,
  6. int? second,
  7. int? millisecond,
  8. int? microsecond,
  9. TimeOfDay? timeOfDay,
  10. DateTime? date,
  11. DateTime? time,
})

Implementation

static DateTime from({
  int? year,
  int? month,
  int? day,
  int? hour,
  int? minute,
  int? second,
  int? millisecond,
  int? microsecond,
  TimeOfDay? timeOfDay,
  DateTime? date,
  DateTime? time,
}) {
  final now = Date.now;
  return DateTime(
    year ?? date?.year ?? now.year,
    month ?? date?.month ?? now.month,
    day ?? date?.day ?? now.day,
    hour ?? time?.hour ?? timeOfDay?.hour ?? now.hour,
    minute ?? time?.minute ?? timeOfDay?.minute ?? now.minute,
    second ?? time?.second ?? now.second,
    millisecond ?? time?.millisecond ?? now.millisecond,
    microsecond ?? time?.microsecond ?? now.microsecond,
  );
}