isVideo property

bool get isVideo

Returns true when the file appears to be a video file.

Detection is based on MIME type and common filename extensions.

Example:

if (file.isVideo) {
  print('This upload is video');
}

Implementation

bool get isVideo {
  final mime = contentType.toLowerCase();
  return mime.startsWith('video/') || ['.mp4', '.webm', '.ogg', '.ogv', '.avi', '.mov', '.mkv'].any((ext) => filename.toLowerCase().endsWith(ext));
}