From 79df5c21ea02f968683c1c0b4af8fbcd0e18ffaa Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 20 Oct 2021 21:27:32 +0800 Subject: [PATCH] update album name property to nullable --- example/lib/main.dart | 4 ++-- lib/src/models/album.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index aef3313..0c5e6cf 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -105,7 +105,7 @@ class _MyAppState extends State { alignment: Alignment.topLeft, padding: EdgeInsets.only(left: 2.0), child: Text( - album.name, + album.name ?? "Unnamed Album", maxLines: 1, textAlign: TextAlign.start, style: TextStyle( @@ -174,7 +174,7 @@ class AlbumPageState extends State { icon: Icon(Icons.arrow_back_ios), onPressed: () => Navigator.of(context).pop(), ), - title: Text(widget.album.name), + title: Text(widget.album.name ?? "Unnamed Album"), ), body: GridView.count( crossAxisCount: 3, diff --git a/lib/src/models/album.dart b/lib/src/models/album.dart index 1c3bc20..d998987 100644 --- a/lib/src/models/album.dart +++ b/lib/src/models/album.dart @@ -10,7 +10,7 @@ class Album { final MediumType? mediumType; /// The name of the album. - final String name; + final String? name; /// The total number of media in the album. final int count;