Chat Fixes & User Chat Counter

merge-requests/81/head
Aamir Muhammad 3 years ago
parent 76c3c5c3ae
commit fb97319164

@ -660,48 +660,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
sFileType = "";
}
// void scrollListener() {
// _firstAutoscrollExecuted = true;
// if (scrollController.hasClients && scrollController.position.pixels == scrollController.position.maxScrollExtent) {
// _shouldAutoscroll = true;
// } else {
// _shouldAutoscroll = false;
// }
// }
//
// void scrollToBottom() {
// scrollController.animateTo(
// scrollController.position.maxScrollExtent + 100,
// duration: const Duration(milliseconds: 500),
// curve: Curves.easeIn,
// );
// }
void msgScroll() {
// scrollController.animateTo(
// // index: 150,
// duration: Duration(seconds: 2),
// curve: Curves.easeInOutCubic);
// scrollController.animateTo(
// scrollController.position.minScrollExtent - 100,
// duration: const Duration(milliseconds: 500),
// curve: Curves.easeIn,
// );
}
// Future<void> getDownLoadFile(String fileName) async {
// var data = await ChatApiClient().downloadURL(fileName: "data");
// Image.memory(data);
// }
// void getUserChatHistoryNotDeliveredAsync({required int userId}) async {
// try {
// await hubConnection.invoke("GetUserChatHistoryNotDeliveredAsync", args: [userId]);
// } finally {
// hubConnection.off("GetUserChatHistoryNotDeliveredAsync", method: chatNotDelivered);
// }
// }
void getUserImages() async {
List<String> emails = [];
for (ChatUser element in searchedChats!) {
@ -714,20 +672,18 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
user.image = uImage.profilePicture ?? "";
user.isImageLoading = false;
user.isImageLoaded = true;
notifyListeners();
}
}
}
for (ChatUser favUser in favUsersList) {
for (ChatUserImageModel uImage in chatImages) {
if (favUser.email == uImage.email) {
favUser.image = uImage.profilePicture ?? "";
favUser.isImageLoading = false;
favUser.isImageLoaded = true;
notifyListeners();
}
}
}
notifyListeners();
}
}

@ -66,11 +66,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
await hubConnection.start();
hubConnection.onreconnecting(({Exception? error}) {
print("============== Reconnecting ======================");
if (hubConnection.state != HubConnectionState.Connected) {
//if (hubConnection.state != HubConnectionState.Connected) {
data.getUserAutoLoginToken().whenComplete(() {
buildHubConnection();
});
}
//}
});
}

Loading…
Cancel
Save