tryParse static method

LocalTime? tryParse(
  1. String text
)

Returns null when text is not a supported wall-clock time.

Implementation

static LocalTime? tryParse(String text) {
  try {
    return LocalTime.parse(text);
  } on FormatException {
    return null;
  } on RangeError {
    return null;
  }
}