ofFileWithSingleHint static method

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

Resolves a format from a local file path.

Implementation

static Future<MediaType?> ofFileWithSingleHint(FileSystemEntity file,
        {String? mediaType,
        String? fileExtension,
        List<Sniffer> sniffers = MediaType.sniffers}) =>
    ofFile(file,
        mediaTypes: [mediaType].whereNotNull().toList(),
        fileExtensions: [fileExtension].whereNotNull().toList(),
        sniffers: sniffers);