From 5ff97adc560bc01a5ad4dd0079e0736703c5ff98 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 1 Aug 2023 19:21:38 +0800 Subject: [PATCH] use an initializing formal to assign a parameter to a field. --- lib/src/models/album.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/models/album.dart b/lib/src/models/album.dart index bd12cda..9cf0995 100644 --- a/lib/src/models/album.dart +++ b/lib/src/models/album.dart @@ -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;