use an initializing formal to assign a parameter to a field.

This commit is contained in:
Wenqi Li 2023-08-01 19:21:38 +08:00
parent c152bb6bbd
commit 5ff97adc56

View File

@ -22,10 +22,8 @@ class Album {
bool get isAllAlbum => id == "__ALL__"; bool get isAllAlbum => id == "__ALL__";
/// Creates a album from platform channel protocol. /// 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'], : id = json['id'],
mediumType = mediumType,
newest = newest,
name = json['name'], name = json['name'],
count = json['count'] ?? 0; count = json['count'] ?? 0;