LocalImage class

A single image on the local device.

Each photo has an id which uniquely identifies it on the local device. Using that id other information about the photo can be retrieved.

Annotations
  • @JsonSerializable()

Constructors

LocalImage(String? id, String? creationDate, int? pixelHeight, int? pixelWidth, String? fileName, int? fileSize, String? mediaType, {int? compression})
const
LocalImage.fromJson(Map<String, dynamic> json)
factory

Properties

compression int?
optional image compression (0-100), default is set to 70
final
creationDate String?
date the image was created as reported by the local device
final
fileName String?
Local filename for the image on the device
final
fileSize int?
Size in bytes of the image on disk
final
hashCode int
The hash code for this object.
no setteroverride
id String?
Unique identifier for the image on the local device, this should be stable across invocations.
final
isImage bool
no setter
isVideo bool
no setter
mediaType String?
'video' or 'img', use the isImage or isVideo properties instead of using this value directly
final
pixelHeight int?
pixel height of the image
final
pixelWidth int?
pixel width of the image
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getImageBytes(LocalImageProvider localImageProvider, int desiredHeight, int desiredWidth) Future<Uint8List>
Returns a jpeg of the image that can be loaded into a MemoryImage.
getScaledImageBytes(LocalImageProvider localImageProvider, double scale) Future<Uint8List>
Returns a jpeg scaled by the given scaling factor in each dimension.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scaleToFit(int height, int width) double
Returns the scale required to fit the image into the given height and width in pixels.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

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

Constants

imageMediaType → const String
videoMediaType → const String