use an initializing formal to assign a parameter to a field.
This commit is contained in:
parent
c152bb6bbd
commit
5ff97adc56
@ -22,10 +22,8 @@ class Album {
|
||||
bool get isAllAlbum => id == "__ALL__";
|
||||
|
||||
/// Creates a album from platform channel protocol.
|
||||
Album.fromJson(dynamic json, MediumType? mediumType, bool newest)
|
||||
Album.fromJson(dynamic json, this.mediumType, this.newest)
|
||||
: id = json['id'],
|
||||
mediumType = mediumType,
|
||||
newest = newest,
|
||||
name = json['name'],
|
||||
count = json['count'] ?? 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user