add default value to models
This commit is contained in:
parent
94e39e8714
commit
f72778a5d3
@ -27,7 +27,7 @@ class Album {
|
|||||||
mediumType = mediumType,
|
mediumType = mediumType,
|
||||||
newest = newest,
|
newest = newest,
|
||||||
name = json['name'],
|
name = json['name'],
|
||||||
count = json['count'];
|
count = json['count'] ?? 0;
|
||||||
|
|
||||||
/// list media in the album.
|
/// list media in the album.
|
||||||
///
|
///
|
||||||
|
@ -19,7 +19,7 @@ class MediaPage {
|
|||||||
|
|
||||||
/// Creates a range of media from platform channel protocol.
|
/// Creates a range of media from platform channel protocol.
|
||||||
MediaPage.fromJson(this.album, dynamic json)
|
MediaPage.fromJson(this.album, dynamic json)
|
||||||
: start = json['start'],
|
: start = json['start'] ?? 0,
|
||||||
items = json['items'].map<Medium>((x) => Medium.fromJson(x)).toList();
|
items = json['items'].map<Medium>((x) => Medium.fromJson(x)).toList();
|
||||||
|
|
||||||
/// Gets the next page of media in the album.
|
/// Gets the next page of media in the album.
|
||||||
|
@ -49,7 +49,7 @@ class Medium {
|
|||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
this.size,
|
this.size,
|
||||||
this.orientation = 0,
|
this.orientation,
|
||||||
this.mimeType,
|
this.mimeType,
|
||||||
this.duration = 0,
|
this.duration = 0,
|
||||||
this.creationDate,
|
this.creationDate,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user