AssetEntity class

Used to describe an asset.

Constructors

AssetEntity({required String id, required int typeInt, required int width, required int height, int duration = 0, int orientation = 0, bool isFavorite = false, String? title, int? createDtSecond, int? modifiedDateSecond, String? relativePath, double? latitude, double? longitude, String? mimeType})

Properties

createDateTime DateTime
create time of asset
no setter
createDtSecond int?
unix timestamp second of asset
getter/setter pair
duration int
Duration of video, unit is second.
getter/setter pair
exists Future<bool>
If the asset is deleted, return false.
no setter
file Future<File?>
If you need upload file ,then you can use the file, nullable.
no setter
fullData Future<Uint8List?>
The asset's bytes.
no setter
hashCode int
The hash code for this object.
no setteroverride
height int
height of asset.
getter/setter pair
id String
in android is database _id column
getter/setter pair
isFavorite bool
Android does not have this field, so it is always false.
getter/setter pair
isLocallyAvailable Future<bool>
Whether this asset is locally available.
no setter
latitude double
Gps information when shooting, nullable.
getter/setter pair
longitude double
Gps information when shooting, nullable.
getter/setter pair
mimeType String?
MimeType of the asset.
getter/setter pair
modifiedDateSecond int?
unix time second of modified.
getter/setter pair
modifiedDateTime DateTime
no setter
orientatedHeight int
no setter
orientatedSize Size
no setter
orientatedWidth int
no setter
orientation int
Orientation of android MediaStore. See ORIENTATION Example values for android: 0 90 180 270
getter/setter pair
originBytes Future<Uint8List?>
The raw data stored in the device, the data may be large.
no setter
originFile Future<File?>
This contains all the EXIF information, but in contrast, Image widget may not be able to display pictures.
no setter
relativePath String?
In iOS, always null.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
The Size for the asset.
no setter
thumbData Future<Uint8List?>
The thumb data of asset, use it to display.
no setter
title String?
It is title MediaStore.MediaColumns.DISPLAY_NAME in MediaStore on android.
getter/setter pair
titleAsync Future<String>
It is title in Android.
no setter
type AssetType
the asset type
no setter
typeInt int
Asset type int value.
getter/setter pair
videoDuration Duration
if not video, duration is 0
no setter
width int
width of asset.
getter/setter pair

Methods

getMediaUrl() Future<String?>
The url is provided to some video player. Such as flutter_ijkplayer
latlngAsync() Future<LatLng>
Get latitude and longitude from MediaStore(android) / Photos(iOS).
loadFile({bool isOrigin = true, PMProgressHandler? progressHandler}) Future<File?>
Use the method to load file.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshProperties() Future<AssetEntity?>
refreshProperties
thumbDataWithOption(ThumbOption option, {PMProgressHandler? progressHandler}) Future<Uint8List?>
Get thumb with size of option.
thumbDataWithSize(int width, int height, {ThumbFormat format = ThumbFormat.jpeg, int quality = 100, PMProgressHandler? progressHandler}) Future<Uint8List?>
get thumb with size
toString() String
A string representation of this object.
override

Operators

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

Static Methods

fromId(String id) Future<AssetEntity?>
Create from AssetEntity.id, not recommended.