of static method

Future<MediaType?> of({
  1. List<String> mediaTypes = const [],
  2. List<String> fileExtensions = const [],
  3. List<Sniffer> sniffers = MediaType.sniffers,
})

Resolves a format from file extension and media type hints, without checking the actual content.

Implementation

static Future<MediaType?> of(
        {List<String> mediaTypes = const [],
        List<String> fileExtensions = const [],
        List<Sniffer> sniffers = MediaType.sniffers}) =>
    _of(
        content: null,
        mediaTypes: mediaTypes,
        fileExtensions: fileExtensions,
        sniffers: sniffers);