From 70ffb8afd801fdce3142dd36857d06cc6a5113b6 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" Date: Wed, 7 Dec 2022 10:40:31 +0300 Subject: [PATCH] Fixes --- lib/provider/chat_provider_model.dart | 2 +- lib/ui/chat/chat_home.dart | 1 + lib/ui/chat/chat_home_screen.dart | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index af565f7..e6985b8 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -503,7 +503,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { dynamic contain = searchedChats!.where((ChatUser element) => element.id == targetUserId); if (contain.isEmpty) { searchedChats!.add( - ChatUser(id: targetUserId, userName: targetUserName, unreadMessageCount: 0, isImageLoading: false, image: null, isImageLoaded: false), + ChatUser(id: targetUserId, userName: targetUserName, unreadMessageCount: 0, isImageLoading: false, image: "", isImageLoaded: true), ); notifyListeners(); } diff --git a/lib/ui/chat/chat_home.dart b/lib/ui/chat/chat_home.dart index 4e218e3..0a8cb42 100644 --- a/lib/ui/chat/chat_home.dart +++ b/lib/ui/chat/chat_home.dart @@ -85,6 +85,7 @@ class _ChatHomeState extends State { onPageChanged: (int pageIndex) { setState(() { tabIndex = pageIndex; + }); }, children: [ diff --git a/lib/ui/chat/chat_home_screen.dart b/lib/ui/chat/chat_home_screen.dart index 641c13d..73868c7 100644 --- a/lib/ui/chat/chat_home_screen.dart +++ b/lib/ui/chat/chat_home_screen.dart @@ -50,7 +50,9 @@ class _ChatHomeScreenState extends State { body: Consumer( builder: (BuildContext context, ChatProviderModel m, Widget? child) { return m.isLoading - ? ChatHomeShimmer(isDetailedScreen: false,) + ? ChatHomeShimmer( + isDetailedScreen: false, + ) : Column( children: [ TextField( @@ -86,7 +88,7 @@ class _ChatHomeScreenState extends State { itemCount: m.searchedChats!.length, shrinkWrap: true, physics: const ClampingScrollPhysics(), - padding: const EdgeInsets.only(bottom: 80.0), + padding: const EdgeInsets.only(bottom: 80.0), itemBuilder: (BuildContext context, int index) { return SizedBox( height: 55, @@ -99,7 +101,7 @@ class _ChatHomeScreenState extends State { height: 48, width: 48, ).toShimmer().circle(30), - if (m.searchedChats![index].isImageLoaded! && m.searchedChats![index].image != null && m.searchedChats![index].image.isNotEmpty) + if (m.searchedChats![index].isImageLoaded! && m.searchedChats![index].image.isNotEmpty) CircularAvatar( radius: 20, height: 48, @@ -197,7 +199,7 @@ class _ChatHomeScreenState extends State { }); }, separatorBuilder: (BuildContext context, int index) => const Divider(color: MyColors.lightGreyE5Color).paddingOnly(left: 59), - ).expanded, + ), ], ).paddingOnly(left: 21, right: 21); },