ofSingleHint static method

Future<MediaType?> ofSingleHint({
  1. String? mediaType,
  2. String? fileExtension,
  3. List<Sniffer> sniffers = MediaType.sniffers,
})

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

Implementation

static Future<MediaType?> ofSingleHint(
        {String? mediaType,
        String? fileExtension,
        List<Sniffer> sniffers = MediaType.sniffers}) =>
    _of(
        content: null,
        mediaTypes: [mediaType].whereNotNull().toList(),
        fileExtensions: [fileExtension].whereNotNull().toList(),
        sniffers: sniffers);