MediaItem class

A single media file returned by MediaManagerPlatform.getMediaPage.

Constructors

MediaItem({required int id, required String uri, required String name, required int size, required int dateModified, required int mediaType, String? mimeType, int width = 0, int height = 0, int duration = 0})
const
MediaItem.fromMap(Map<String, dynamic> m)
factory

Properties

dateModified int
Last-modified timestamp in milliseconds since epoch.
final
duration int
Audio / video duration in milliseconds (0 if unavailable).
final
hashCode int
The hash code for this object.
no setterinherited
height int
Image / video height in pixels (0 if unavailable).
final
id int
MediaStore row ID (Android) or iCloud asset ID (iOS).
final
kind String
Convenience kind derived from mimeType. Returns "video", "audio", or "image" (fallback).
no setter
mediaType int
Raw platform media-type constant (MediaStore.Files.FileColumns.MEDIA_TYPE on Android).
final
mimeType String?
MIME type string, e.g. "image/jpeg". May be null.
final
name String
Display name (file name including extension).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
File size in bytes.
final
uri String
content:// URI on Android; absolute file path on iOS/macOS.
final
width int
Image / video width in pixels (0 if unavailable).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited