We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36fc5c9 commit 8b4a432Copy full SHA for 8b4a432
examples/catalog_gallery/lib/main.dart
@@ -57,7 +57,10 @@ class _CatalogGalleryHome extends StatelessWidget {
57
final messageText = message.parts
58
.whereType<TextPart>()
59
.map((p) => p.text)
60
- .last;
+ .lastOrNull;
61
+ if (messageText == null) {
62
+ return;
63
+ }
64
ScaffoldMessenger.of(
65
context,
66
).showSnackBar(SnackBar(content: Text('User action: $messageText')));
0 commit comments