fromCodeNullable static method

Language? fromCodeNullable(
  1. String? code
)

Returns the language for the given language code.

Implementation

static Language? fromCodeNullable(String? code) {
  if (code == null) {
    return null;
  }
  try {
    return fromCode(code);
  } catch (e) {
    return null;
  }
}