diff --git a/lib/ui/screens/conversations_list_screen.dart b/lib/ui/screens/conversations_list_screen.dart index 339cbae..38a8b09 100644 --- a/lib/ui/screens/conversations_list_screen.dart +++ b/lib/ui/screens/conversations_list_screen.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:comunic/enums/load_error_level.dart'; import 'package:comunic/helpers/conversations_helper.dart'; import 'package:comunic/helpers/events_helper.dart'; @@ -179,6 +181,14 @@ class _ConversationScreenState extends SafeState { physics: AlwaysScrollableScrollPhysics(), controller: ScrollController(), itemBuilder: (context, index) { + if (_list!.isEmpty) + return Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + tr("You do not have any conversation yet!")!)), + ); + if (_list![index].isGroupConversation && !_list![index].following) return Container(); @@ -193,7 +203,7 @@ class _ConversationScreenState extends SafeState { onRequestLeave: _requestLeaveConversation, ); }, - itemCount: _list!.length, + itemCount: max(_list!.length, 1), ), ), ),