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 09c9380..ef1aed3 100644 --- a/packages/flutter_chat_view/lib/src/screens/chat_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/chat_screen.dart @@ -163,6 +163,8 @@ class _ChatScreenState extends State { padding: const EdgeInsets.all(16.0), child: Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.stretch, children: [ Text( chat.canBeDeleted @@ -170,50 +172,80 @@ class _ChatScreenState extends State { .deleteChatModalTitle : translations .chatCantBeDeleted, + textAlign: TextAlign.center, style: const TextStyle( - fontSize: 20, + fontSize: 24, fontWeight: FontWeight.bold, ), ), - const SizedBox(height: 16), + const SizedBox(height: 24), if (chat.canBeDeleted) - Text( - translations - .deleteChatModalDescription, - style: const TextStyle( - fontSize: 16, + Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + ), + child: Text( + translations + .deleteChatModalDescription, + textAlign: + TextAlign.center, + style: const TextStyle( + fontSize: 18, + ), ), ), - const SizedBox(height: 16), + const SizedBox( + height: 24, + ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - TextButton( - child: Text( - translations - .deleteChatModalCancel, - style: const TextStyle( - fontSize: 16, - ), - ), + ElevatedButton( onPressed: () => Navigator.of( context, ).pop(false), + child: Text( + translations + .deleteChatModalCancel, + style: const TextStyle( + color: Colors.black, + fontSize: 18, + ), + ), ), + if (chat.canBeDeleted) + const SizedBox( + width: 16, + ), if (chat.canBeDeleted) ElevatedButton( + style: ElevatedButton + .styleFrom( + backgroundColor: + const Color + .fromRGBO( + 113, + 198, + 209, + 1, + ), + ), onPressed: () => Navigator.of( context, - ).pop(true), + ).pop( + true, + ), child: Text( translations .deleteChatModalConfirm, style: const TextStyle( - fontSize: 16, + color: Colors.white, + fontSize: 18, ), ), ), diff --git a/packages/flutter_chat_view/lib/src/screens/new_group_chat_screen.dart b/packages/flutter_chat_view/lib/src/screens/new_group_chat_screen.dart index ff7d633..31cfc66 100644 --- a/packages/flutter_chat_view/lib/src/screens/new_group_chat_screen.dart +++ b/packages/flutter_chat_view/lib/src/screens/new_group_chat_screen.dart @@ -146,59 +146,62 @@ class _NewGroupChatScreenState extends State { return widget.options.noChatsPlaceholderBuilder(widget.translations); } -return ListView.separated( - itemCount: filteredUsers.length, - separatorBuilder: (context, index) => const Padding( - padding: EdgeInsets.symmetric(horizontal: 28.0), - child: Divider(), - ), // Add Divider here - itemBuilder: (context, index) { - var user = filteredUsers[index]; - var isSelected = selectedUserList.any((selectedUser) => selectedUser == user); + return ListView.separated( + itemCount: filteredUsers.length, + separatorBuilder: (context, index) => const Padding( + padding: EdgeInsets.symmetric(horizontal: 28.0), + child: Divider(), + ), // Add Divider here + itemBuilder: (context, index) { + var user = filteredUsers[index]; + var isSelected = + selectedUserList.any((selectedUser) => selectedUser == user); - return InkWell( - onTap: () { - setState(() { - if (selectedUserList.contains(user)) { - selectedUserList.remove(user); - } else { - selectedUserList.add(user); - } - debugPrint('The list of selected users is $selectedUserList'); - }); - }, - child: Container( - color: isSelected ? Colors.amber.shade200 : Colors.white, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 30), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(left: 12.0, right: 12), - child: widget.options.userAvatarBuilder(user, 40.0), - ), - Expanded( - child: Container( - height: 40.0, // Adjust the height as needed - alignment: Alignment.centerLeft, - child: Text( - user.fullName ?? widget.translations.anonymousUser, - style: const TextStyle( - fontWeight: FontWeight.w800, + return InkWell( + onTap: () { + setState(() { + if (selectedUserList.contains(user)) { + selectedUserList.remove(user); + } else { + selectedUserList.add(user); + } + debugPrint('The list of selected users is $selectedUserList'); + }); + }, + child: Container( + color: isSelected ? Colors.amber.shade200 : Colors.white, + child: Padding( + padding: + const EdgeInsets.symmetric(vertical: 12.0, horizontal: 30), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.only(left: 12.0, right: 12), + child: widget.options.userAvatarBuilder(user, 40.0), + ), + Expanded( + child: Container( + height: 40.0, // Adjust the height as needed + alignment: Alignment.centerLeft, + child: Text( + user.fullName ?? widget.translations.anonymousUser, + style: const TextStyle( + fontWeight: FontWeight.w800, + ), + ), ), ), - ), + if (isSelected) + const Padding( + padding: EdgeInsets.only(right: 16.0), + child: Icon(Icons.check_circle, color: Colors.green), + ), + ], ), - if (isSelected) - const Padding( - padding: EdgeInsets.only(right: 16.0), - child: Icon(Icons.check_circle, color: Colors.green), - ), - ], + ), ), - ), - ), + ); + }, ); - }, -); - }} \ No newline at end of file + } +}