Skip to content

Commit 8b4a432

Browse files
committed
apply suggestion
1 parent 36fc5c9 commit 8b4a432

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/catalog_gallery/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ class _CatalogGalleryHome extends StatelessWidget {
5757
final messageText = message.parts
5858
.whereType<TextPart>()
5959
.map((p) => p.text)
60-
.last;
60+
.lastOrNull;
61+
if (messageText == null) {
62+
return;
63+
}
6164
ScaffoldMessenger.of(
6265
context,
6366
).showSnackBar(SnackBar(content: Text('User action: $messageText')));

0 commit comments

Comments
 (0)