From 9d929c7741bb587bcfaa31b12ab08687d5fd6810 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 30 May 2020 21:07:54 +1000 Subject: [PATCH] Display a message if a part does not have a category sit --- lib/widget/part_detail.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/widget/part_detail.dart b/lib/widget/part_detail.dart index e4acceff..7a99fff2 100644 --- a/lib/widget/part_detail.dart +++ b/lib/widget/part_detail.dart @@ -133,7 +133,7 @@ class _PartDisplayState extends RefreshableState { ); // Category information - if (part.categoryName.isNotEmpty) { + if (part.categoryName != null && part.categoryName.isNotEmpty) { tiles.add( ListTile( title: Text("Part Category"), @@ -149,6 +149,14 @@ class _PartDisplayState extends RefreshableState { }, ) ); + } else { + tiles.add( + ListTile( + title: Text("Part Category"), + subtitle: Text("No category set"), + leading: FaIcon(FontAwesomeIcons.stream), + ) + ); } // External link?