hasPDFExtension static method

bool hasPDFExtension(
  1. String filePath
)

Checks if the given file path has a PDF extension.

This is a simple extension check and does not verify if the file is actually a valid PDF. For accurate PDF detection, use isPDF instead.

Parameters:

  • filePath: The file path to check

Returns: true if the file has a .pdf extension, false otherwise

Implementation

static bool hasPDFExtension(String filePath) =>
    p.extension(filePath) == ".pdf";