from static method

FlexiDate? from(
  1. dynamic input
)

Implementation

static FlexiDate? from(dynamic input) {
  if (input == null) return null;
  if (input is FlexiDate) return input;
  if (input is DateTime) return FlexiDate.ofDateTime(input);
  if (input is Map) return FlexiDateData.fromMap(input);
  var inputString = "$input";
  if (inputString.isEmpty) {
    return null;
  } else {
    return instance.parse(inputString);
  }
}