diff --git a/example/ios/Flutter/.last_build_id b/example/ios/Flutter/.last_build_id index f57e1e1f..1e10204b 100644 --- a/example/ios/Flutter/.last_build_id +++ b/example/ios/Flutter/.last_build_id @@ -1 +1 @@ -c770358a10272b4ee1cdc2eb432445f6 \ No newline at end of file +c1153e968f5d6bcc19c41ac2592825f6 \ No newline at end of file diff --git a/example/lib/customize_channel_preview.dart b/example/lib/customize_channel_preview.dart index 3809f780..503987ae 100644 --- a/example/lib/customize_channel_preview.dart +++ b/example/lib/customize_channel_preview.dart @@ -62,7 +62,7 @@ class ChannelListPage extends StatelessWidget { } }, channelPreviewBuilder: _channelPreviewBuilder, - sort: [SortOption('last_message_at')], + // sort: [SortOption('last_message_at')], pagination: PaginationParams( limit: 20, ), @@ -73,8 +73,10 @@ class ChannelListPage extends StatelessWidget { } Widget _channelPreviewBuilder(BuildContext context, Channel channel) { - final lastMessage = channel.state.messages.reversed - .firstWhere((message) => !message.isDeleted); + final lastMessage = channel.state.messages.reversed.firstWhere( + (message) => !message.isDeleted, + orElse: () => null, + ); final subtitle = (lastMessage == null ? "nothing yet" : lastMessage.text); final opacity = channel.state.unreadCount > .0 ? 1.0 : 0.5;