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