FLUTTER ECOSYSTEM

file_magic_number

A Flutter package to detect file types based on their magic number instead of MIME types. Supports Flutter on mobile, desktop, and web without native code.

Latest version
1.4.2
30-day downloads
9.5K
Likes
28
Pub points
160

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

A Flutter package that identifies file types by analyzing their magic numbers—unique byte sequences at the beginning of files—rather than relying on MIME types or file extensions. It works across all platforms including mobile, desktop, and web without requiring native code. This approach ensures accurate file detection even when metadata is missing or misleading. The package is lightweight, easy to integrate, and ideal for applications needing reliable file type recognition.

Use cases
  • File upload validation
  • Media file detection
  • Secure file handling
  • Cross-platform file analysis
  • Automated file categorization
Key features
  • Magic number-based detection
  • No native code required
  • Supports all Flutter platforms
  • Lightweight and fast
  • Accurate file type identification
Suitable for
  • Developers building file-heavy apps
  • Apps requiring secure file processing
  • Cross-platform file utilities
  • Tools needing robust file type detection
Considerations
  • May not detect all obscure file formats
  • Relies on known magic number database
  • Limited to header-based identification only
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add file_magic_number

Categories

Related projects