diff --git a/lib/pages/chat_page.dart b/lib/pages/chat_page.dart index d9996eb..ea8bc2a 100644 --- a/lib/pages/chat_page.dart +++ b/lib/pages/chat_page.dart @@ -11,12 +11,14 @@ class ChatPage extends StatefulWidget { final String receiverEmail; final String receiverID; final String chatTitle; + final String? profileImageUrl; const ChatPage({ super.key, required this.receiverEmail, required this.receiverID, required this.chatTitle, + this.profileImageUrl, }); @override @@ -90,8 +92,20 @@ class _ChatPageState extends State { @override Widget build(BuildContext context) { + Widget chatHeader = Text(widget.chatTitle); + Widget? userPic; + if (widget.profileImageUrl != null && widget.profileImageUrl!.isNotEmpty) { + userPic = + CircleAvatar(backgroundImage: NetworkImage(widget.profileImageUrl!)); + } + if (userPic != null) { + chatHeader = Row( + children: [userPic, const SizedBox(width: 7), Text(widget.chatTitle)], + ); + } + return Scaffold( - appBar: AppBar(title: Text(widget.chatTitle)), + appBar: AppBar(title: chatHeader), body: Column( children: [ // display all messages diff --git a/lib/pages/conversations_page.dart b/lib/pages/conversations_page.dart index de84733..ec33660 100644 --- a/lib/pages/conversations_page.dart +++ b/lib/pages/conversations_page.dart @@ -15,7 +15,7 @@ class ConversationsPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('My Chat Contacts'), + title: const Text('My Chat Connections'), ), body: _buildUserMatchesList(), ); @@ -78,6 +78,7 @@ class ConversationsPage extends StatelessWidget { receiverEmail: userData[Constants.dbFieldUsersEmail], receiverID: userData[Constants.dbFieldUsersID], chatTitle: userData[Constants.dbFieldUsersName], + profileImageUrl: userData[Constants.dbFieldUsersProfilePic], ), ), ); diff --git a/lib/pages/liked_users_page.dart b/lib/pages/liked_users_page.dart index 6bb180e..1581975 100644 --- a/lib/pages/liked_users_page.dart +++ b/lib/pages/liked_users_page.dart @@ -340,6 +340,7 @@ class LikedUsersPageState extends State { receiverEmail: user[Constants.dbFieldUsersEmail], receiverID: user[Constants.dbFieldUsersID], chatTitle: user[Constants.dbFieldUsersName], + profileImageUrl: user[Constants.dbFieldUsersProfilePic], ), ), ); diff --git a/lib/pages/user_matching_page.dart b/lib/pages/user_matching_page.dart index 2701ed4..65abe67 100644 --- a/lib/pages/user_matching_page.dart +++ b/lib/pages/user_matching_page.dart @@ -261,6 +261,7 @@ class UserMatchingPageState extends State { receiverEmail: swipedUser.email, receiverID: swipedUser.uid, chatTitle: swipedUser.name, + profileImageUrl: swipedUser.profilePictureUrl, ), ), );