isPDF static method

Future<bool> isPDF(
  1. String filePath
)

Determines whether the given file path corresponds to a PDF file.

This method checks if the file path ends with the .pdf extension (case insensitive).

Implementation

static Future<bool> isPDF(String filePath) async {
  try {
    return await FileMagicNumber.detectFileTypeFromPathOrBlob(filePath) ==
        FileMagicNumberType.pdf;
  } catch (e) {
    return false;
  }
}