diff --git a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart index 491dac1..59c77a2 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_detail_screen.dart @@ -172,16 +172,14 @@ class _ChatDetailScreenState extends State { iconTheme: theme.appBarTheme.iconTheme ?? const IconThemeData(color: Colors.white), centerTitle: true, - leading: (chatModel is GroupChatModel) - ? GestureDetector( + leading: GestureDetector( onTap: () { Navigator.popUntil(context, (route) => route.isFirst); }, child: const Icon( Icons.arrow_back, ), - ) - : null, + ), title: GestureDetector( onTap: () => widget.onPressChatTitle.call(context, chatModel!), child: Row( @@ -209,7 +207,7 @@ class _ChatDetailScreenState extends State { (chatModel is GroupChatModel) ? chatModel.title : (chatModel is PersonalChatModel) - ? chatModel.user.fullName ?? + ? chatModel.user.firstName ?? widget.translations.anonymousUser : '', ) @@ -217,7 +215,7 @@ class _ChatDetailScreenState extends State { (chatModel is GroupChatModel) ? chatModel.title : (chatModel is PersonalChatModel) - ? chatModel.user.fullName ?? + ? chatModel.user.firstName ?? widget.translations.anonymousUser : '', style: theme.appBarTheme.titleTextStyle ?? diff --git a/packages/flutter_chat_view/lib/src/screens/chat_screen.dart b/packages/flutter_chat_view/lib/src/screens/chat_screen.dart index 444f1ac..09c9380 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_screen.dart @@ -130,6 +130,15 @@ class _ChatScreenState extends State { await widget.onNoChats!.call(); }); } + return Center( + child: Text( + translations.noChatsFound, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w400, + ), + ), + ); } else { _hasCalledOnNoChats = false; // Reset the flag if there are chats