generateDateFormat static method

String generateDateFormat(
  1. String? dateFormat,
  2. DateTimePickerMode pickerMode
)

Get default value of date format.

Implementation

static String generateDateFormat(
    String? dateFormat, DateTimePickerMode pickerMode) {
  if (dateFormat != null && dateFormat.isNotEmpty) {
    return dateFormat;
  }
  switch (pickerMode) {
    case DateTimePickerMode.date:
      return datetimePickerDateFormat;
    case DateTimePickerMode.time:
      return datetimePickerTimeFormat;
    case DateTimePickerMode.datetime:
      return datetimePickerDatetimeFormat;
  }
}