ofFilePath static method

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

Resolves a format from a local file path.

Implementation

static Future<MediaType?> ofFilePath(String path,
        {List<String> mediaTypes = const [],
        List<String> fileExtensions = const [],
        List<Sniffer> sniffers = MediaType.sniffers}) =>
    ofFile(File(path),
        mediaTypes: mediaTypes,
        fileExtensions: fileExtensions,
        sniffers: sniffers);