hasTopLevelMediaType method

bool hasTopLevelMediaType(
  1. String mediaType
)

Returns whether the file has the given top-level media type.

Implementation

bool hasTopLevelMediaType(String mediaType) {
  if (this.mediaType == null) return false;
  final topLevel = this.mediaType!.split('/').first;
  return topLevel == mediaType;
}