update album name property to nullable

This commit is contained in:
Wenqi Li 2021-10-20 21:27:32 +08:00
parent 50d9070995
commit 79df5c21ea
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ class _MyAppState extends State<MyApp> {
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<AlbumPage> {
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,

View File

@ -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;