Photo class
The Photo resource is a JSON formatted version of a Pexels photo. The Photo API endpoints respond with the photo data formatted in this shape.
Constructors
- Photo({required int? id, required int? width, required int? height, required String? url, required String? photographer, required String? photographerUrl, required int? photographerId, required String? avgColor, required PhotoSrc? src, required bool liked, required String? alt})
- Named ConstructorsPhoto with require params
-
Photo.fromJson(Map<
String, dynamic> json) -
PexelsResult.fromJsonMapping data to Photofactory
Properties
- alt ↔ String?
-
Text description of the photo for use in the alt attribute.
getter/setter pair
- avgColor ↔ String?
-
The average color of the photo. Useful for a placeholder while the image loads.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ int?
-
The real height of the photo in pixels.
getter/setter pair
- id ↔ int?
-
The id of the photographer.
getter/setter pair
- liked ↔ bool
-
Photo like status true or false
getter/setter pair
- photographer ↔ String?
-
The name of the photographer who took the photo.
getter/setter pair
- photographerId ↔ int?
-
The id of the photographer.
getter/setter pair
- photographerUrl ↔ String?
-
The URL of the photographer's Pexels profile.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- src ↔ PhotoSrc?
-
An assortment of different image sizes that can be used to display this PhotoSrc.
getter/setter pair
- url ↔ String?
-
The Pexels URL where the photo is located.
getter/setter pair
- width ↔ int?
-
The real width of the photo in pixels.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited