From 4926228164dd47d012b2eb20b703a393a8d16b93 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Sat, 12 Jun 2021 23:18:41 +0800 Subject: [PATCH] Simplify Album.toString --- lib/entity/album.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/entity/album.dart b/lib/entity/album.dart index 6638e920..83a3263d 100644 --- a/lib/entity/album.dart +++ b/lib/entity/album.dart @@ -159,11 +159,13 @@ class Album with EquatableMixin { } @override - toString() { + toString({bool isDeep = false}) { + final itemsStr = + isDeep ? items.toReadableString() : "List {length: ${items.length}}"; return "$runtimeType {" "lastUpdated: $lastUpdated, " "name: $name, " - "items: ${items.toReadableString()}, " + "items: $itemsStr, " "albumFile: $albumFile, " "}"; }