GalleryAsset class

Inheritance
Available extensions

Constructors

GalleryAsset.new({required String id, required int height, required int width, required int typeInt, int duration = 0, int orientation = 0, bool isFavorite = false, String? title, int? createDateSecond, int? modifiedDateSecond, String? relativePath, double? latitude, double? longitude, String? mimeType, int subtype = 0, Uint8List? pickedThumbData, File? pickedFile})
const

Properties

createDateSecond int?
The create time in unix timestamp of the asset.
finalinherited
createDateTime DateTime
The create time of the asset in DateTime.
no setterinherited
duration int
The duration of the asset, but in different units.
finalinherited
exists Future<bool>
Check whether the asset has been deleted.
no setterinherited
file Future<File?>
Obtain the compressed file of the asset.
no setterinherited
fileWithSubtype Future<File?>
Obtain the compressed file of the asset with subtype.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
height int
The height of the asset.
finalinherited
id String
The ID of the asset.
finalinherited
isFavorite bool
Whether the asset is favorite on the device.
finalinherited
isLivePhoto bool
Whether the asset is a live photo. Only valid on iOS/macOS.
no setterinherited
latitude double?
Latitude value of the location when shooting.
no setterinherited
longitude double?
Latitude value of the location when shooting.
no setterinherited
mimeType String?
The mime type of the asset.
finalinherited
mimeTypeAsync Future<String?>
Get the mime type async.
no setterinherited
modifiedDateSecond int?
The modified time in unix timestamp of the asset.
finalinherited
modifiedDateTime DateTime
The modified time of the asset in DateTime.
no setterinherited
orientatedHeight int
The orientated height according to the orientation.
no setterinherited
orientatedSize Size
The orientated size according to the orientation.
no setterinherited
orientatedWidth int
The orientated width according to the orientation.
no setterinherited
orientation int
The orientation of the asset.
finalinherited
originBytes Future<Uint8List?>
Obtain the raw data of the asset.
no setterinherited
originFile Future<File?>
Obtain the original file that contain all EXIF information.
no setterinherited
originFileWithSubtype Future<File?>
Obtain the origin file with subtype.
no setterinherited
pickedFile File?
asset is stored
final
pickedThumbData Uint8List?
Thumb bytes of image and video. Dont use this for other asset types.
final
relativePath String?
The relative path abstraction of the asset.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
The Size for the asset.
no setterinherited
subtype int
The subtype of the asset.
finalinherited
thumbnailData Future<Uint8List?>
Obtain the thumbnail data with PMConstants.vDefaultThumbnailSize size of the asset, typically use it for preview displays.
no setterinherited
title String?
The title field of the asset.
finalinherited
titleAsync Future<String>
  • Android: MediaStore.MediaColumns.DISPLAY_NAME.
  • iOS/macOS: PHAssetResource.originalFilename.
  • no setterinherited
    titleAsyncWithSubtype Future<String>
  • Android: MediaStore.MediaColumns.DISPLAY_NAME.
  • iOS/macOS: PHAssetResource.originalFilename.
  • no setterinherited
    toGalleryAsset GalleryAsset

    Available on AssetEntity, provided by the AssetEntityExt extension

    Convert AssetEntity to GalleryAsset
    no setter
    type AssetType
    The type of the asset.
    no setterinherited
    typeInt int
    The type value of the type.
    finalinherited
    videoDuration Duration
    The video duration in seconds.
    no setterinherited
    width int
    The width of the asset.
    finalinherited

    Methods

    copyWith({Uint8List? pickedThumbData, File? pickedFile, String? id, int? typeInt, int? width, int? height, int? duration, int? orientation, bool? isFavorite, String? title, int? createDateSecond, int? modifiedDateSecond, String? relativePath, double? latitude, double? longitude, String? mimeType, int? subtype}) GalleryAsset
    override
    durationWithOptions({bool withSubtype = false}) Future<int>
    Obtain the duration with the given options.
    inherited
    getMediaUrl({PMProgressHandler? progressHandler}) Future<String?>
    Provide regular URL for players.
    inherited
    isLocallyAvailable({bool isOrigin = false, bool withSubtype = false, PMDarwinAVFileType? darwinFileType}) Future<bool>
    Whether this asset is locally available.
    inherited
    latlngAsync() Future<LatLng>
    Obtain latitude and longitude.
    inherited
    loadFile({bool isOrigin = true, bool withSubtype = false, PMProgressHandler? progressHandler, PMDarwinAVFileType? darwinFileType}) Future<File?>
    Obtain file of the asset with a PMProgressHandler.
    inherited
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    obtainForNewProperties() Future<AssetEntity?>
    Refresh properties for the current asset and return a new object.
    inherited
    thumbnailDataWithOption(ThumbnailOption option, {PMProgressHandler? progressHandler}) Future<Uint8List?>
    Obtain the thumbnail data with the given customized ThumbnailOption.
    inherited
    thumbnailDataWithSize(ThumbnailSize size, {ThumbnailFormat format = ThumbnailFormat.jpeg, int quality = 100, PMProgressHandler? progressHandler, int frame = 0}) Future<Uint8List?>
    Obtain the thumbnail data with the given width and height of the asset.
    inherited
    toString() String
    A string representation of this object.
    inherited

    Operators

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