From c464724bc8b08d952df58fd7ab0397779fd1ede8 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Date: Fri, 15 Oct 2021 11:43:25 +0500 Subject: [PATCH] updates --- .../contact_detail_conversation.dart | 4 +-- .../views/conversation/conversation_view.dart | 26 ++++++++++++++----- .../group_detail_conversation.dart | 10 +++---- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/packages/simplex_app/lib/views/conversation/contact_detail_conversation.dart b/packages/simplex_app/lib/views/conversation/contact_detail_conversation.dart index 0b4b5675b..00c505129 100644 --- a/packages/simplex_app/lib/views/conversation/contact_detail_conversation.dart +++ b/packages/simplex_app/lib/views/conversation/contact_detail_conversation.dart @@ -12,7 +12,7 @@ class ContactDetailsConversation extends StatelessWidget { return Scaffold( appBar: AppBar( centerTitle: true, - title: Text(contact.name), + title: Text(contact.name!), ), body: Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), @@ -26,7 +26,7 @@ class ContactDetailsConversation extends StatelessWidget { ), const SizedBox(height: 15.0), const Text('Display Name', style: kMediumHeadingStyle), - Text(contact.name), + Text(contact.name!), ], ), ), diff --git a/packages/simplex_app/lib/views/conversation/conversation_view.dart b/packages/simplex_app/lib/views/conversation/conversation_view.dart index 5c6cb39b2..15ab83835 100644 --- a/packages/simplex_app/lib/views/conversation/conversation_view.dart +++ b/packages/simplex_app/lib/views/conversation/conversation_view.dart @@ -104,7 +104,14 @@ class _ConversationViewState extends State { _chatMessages.add(MessageBubble( isUser: false, // ignore: avoid_dynamic_calls - sender: widget.data.name, + sender: widget.data.isGroup + // ignore: avoid_dynamic_calls + ? widget.data.members.length == 0 + ? 'some person' + // ignore: avoid_dynamic_calls + : widget.data.members[0] + // ignore: avoid_dynamic_calls + : widget.data.name, text: 'Hey there! How is it going?', )); }); @@ -137,6 +144,7 @@ class _ConversationViewState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ + const SizedBox(width: 10.0), Expanded( child: SizedBox( height: 45.0, @@ -155,16 +163,19 @@ class _ConversationViewState extends State { hintStyle: Theme.of(context).textTheme.caption, fillColor: Colors.grey[200], filled: true, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.transparent), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(360), + borderSide: + const BorderSide(color: Colors.transparent), ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.transparent), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(360), + borderSide: + const BorderSide(color: Colors.transparent), ), ), ), )), - const SizedBox(width: 4.0), IconButton( onPressed: () { if (_messageFieldController.text.isNotEmpty) { @@ -185,6 +196,9 @@ class _ConversationViewState extends State { ], ), ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ) ], ), ), diff --git a/packages/simplex_app/lib/views/conversation/group_detail_conversation.dart b/packages/simplex_app/lib/views/conversation/group_detail_conversation.dart index 6beaa4fed..d294bd5cf 100644 --- a/packages/simplex_app/lib/views/conversation/group_detail_conversation.dart +++ b/packages/simplex_app/lib/views/conversation/group_detail_conversation.dart @@ -27,7 +27,7 @@ class _GroupDetailsConversationState extends State { // getting all members of group void _getMembers() { setState(() { - _members = List.from(widget.group.members); + _members = List.from(widget.group.members!); }); } @@ -64,7 +64,7 @@ class _GroupDetailsConversationState extends State { return Scaffold( appBar: AppBar( centerTitle: true, - title: Text(widget.group.name), + title: Text(widget.group.name!), ), body: SingleChildScrollView( child: Padding( @@ -77,12 +77,12 @@ class _GroupDetailsConversationState extends State { radius: 70, backgroundImage: widget.group.photo == '' ? const AssetImage('assets/dp.png') as ImageProvider - : FileImage(File(widget.group.photo)), + : FileImage(File(widget.group.photo!)), ), ), const SizedBox(height: 25.0), const Text('Group Name', style: kMediumHeadingStyle), - Text(widget.group.name), + Text(widget.group.name!), const Divider(), ListTile( leading: const Icon(Icons.person_add), @@ -137,7 +137,7 @@ class _GroupDetailsConversationState extends State { leading: const CircleAvatar( backgroundImage: AssetImage('assets/dp.png'), ), - title: Text(_contactsList[index].name), + title: Text(_contactsList[index].name!), onTap: () { setState(() { _newMembers.add(_contactsList[index].name);