parse static method

MediaType? parse(
  1. String string, {
  2. String? name,
  3. String? fileExtension,
})

Creates a MediaType from its string representation.

Implementation

static MediaType? parse(String string,
    {String? name, String? fileExtension}) {
  try {
    return MediaType._create(string,
        name: name, fileExtension: fileExtension);
  } on Error catch (e, stacktrace) {
    Fimber.e("MediaType._create ERROR", ex: e, stacktrace: stacktrace);
    return null;
  }
}