From b4fc3dd5fd4fa760e1ef27e056ee8ee69d580a8e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 26 Dec 2022 15:16:11 +0300 Subject: [PATCH 1/3] version fixes --- android/app/google-services.json | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/google-services.json b/android/app/google-services.json index 5befc36..62fbaea 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -10,7 +10,7 @@ "client_info": { "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", "android_client_info": { - "package_name": "com.cloudSolutions.mohemmtest" + "package_name": "hmg.cloudSolutions.mohem" } }, "oauth_client": [ diff --git a/pubspec.yaml b/pubspec.yaml index 2f3fffa..f6e6797 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +version: 3.1.5+300015 environment: sdk: ">=2.16.0 <3.0.0" From e5310eff4ea349a1082a9a298ca3c757f7402b95 Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Mon, 26 Dec 2022 17:04:10 +0300 Subject: [PATCH 2/3] Removed Unnecessary API call --- lib/api/marathon/marathon_api_client.dart | 1 + lib/ui/marathon/marathon_provider.dart | 27 ++++++++++------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/api/marathon/marathon_api_client.dart b/lib/api/marathon/marathon_api_client.dart index 5b1dfc8..28fad0f 100644 --- a/lib/api/marathon/marathon_api_client.dart +++ b/lib/api/marathon/marathon_api_client.dart @@ -29,6 +29,7 @@ class MarathonApiClient { (json) { MarathonGenericModel marathonModel = MarathonGenericModel.fromJson(json); AppState().setMarathonToken = marathonModel.data["token"] ?? ""; + print("marathonToken: ${"AppState(): ${AppState().getMarathonToken}"}"); return marathonModel.data["token"] ?? ""; }, ApiConsts.marathonParticipantLoginUrl, diff --git a/lib/ui/marathon/marathon_provider.dart b/lib/ui/marathon/marathon_provider.dart index 21c5915..1b825e8 100644 --- a/lib/ui/marathon/marathon_provider.dart +++ b/lib/ui/marathon/marathon_provider.dart @@ -435,7 +435,6 @@ class MarathonProvider extends ChangeNotifier { } bool checkIfPrivilegedForMarathon() { - return true; for (PrivilegeListModel element in AppState().privilegeListModel!) { if (element.serviceName == "Marathon") { if (element.previlege != null) { @@ -451,20 +450,18 @@ class MarathonProvider extends ChangeNotifier { notifyListeners(); isPrivilegedWithMarathon = checkIfPrivilegedForMarathon(); if (isPrivilegedWithMarathon) { - await MarathonApiClient().getMarathonToken().whenComplete(() async { - marathonDetailModel = await MarathonApiClient().getMarathonDetails(); - updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30; - if (marathonDetailModel.id == null) { - isUpComingMarathon = false; - isLoading = false; - notifyListeners(); - return; - } - if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) { - itsMarathonTime = false; - } - populateQuestionStatusesList(); - }); + marathonDetailModel = await MarathonApiClient().getMarathonDetails(); + updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30; + if (marathonDetailModel.id == null) { + isUpComingMarathon = false; + isLoading = false; + notifyListeners(); + return; + } + if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) { + itsMarathonTime = false; + } + populateQuestionStatusesList(); } isLoading = false; notifyListeners(); From 2ab39e0d7b0334fff442bcd068836cf80b6964d5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 27 Dec 2022 14:22:57 +0300 Subject: [PATCH 3/3] updates --- lib/provider/chat_provider_model.dart | 15 +++++----- lib/ui/chat/chat_bubble.dart | 13 ++++---- lib/ui/chat/my_team_screen.dart | 43 +++++++++++++-------------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 24c4532..57abd3a 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -82,7 +82,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } Future buildHubConnection() async { - chatHubConnection = await getHubConnection(); await chatHubConnection.start(); if (kDebugMode) { @@ -1265,7 +1264,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { await Directory(dirPath).create(); await File('$dirPath/.nomedia').create(); } - File file = File("$dirPath/${data.currentUserId}-${data.targetUserId}-${DateTime.now().microsecondsSinceEpoch}." + ext); + File file = File("$dirPath/${data.currentUserId}-${data.targetUserId}-${DateTime.now().microsecondsSinceEpoch}" + ext); await file.writeAsBytes(bytes); return file.path; } @@ -1297,7 +1296,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { ChatUser( id: int.parse(element.eMPLOYEENUMBER!), email: element.eMPLOYEEEMAILADDRESS, - userName: element.eMPLOYEEDISPLAYNAME, + userName: element.eMPLOYEENAME, phone: element.eMPLOYEEMOBILENUMBER, userStatus: 0, unreadMessageCount: 0, @@ -1305,8 +1304,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { isTyping: false, isImageLoading: false, image: element.eMPLOYEEIMAGE ?? "", - isImageLoaded: true, - userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), + isImageLoaded: element.eMPLOYEEIMAGE == null ? false : true, + userLocalDownlaodedImage:element.eMPLOYEEIMAGE == null ? null : await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), ), ); } @@ -1319,7 +1318,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { ChatUser( id: int.parse(element.eMPLOYEENUMBER!), email: element.eMPLOYEEEMAILADDRESS, - userName: element.eMPLOYEEDISPLAYNAME, + userName: element.eMPLOYEENAME, phone: element.eMPLOYEEMOBILENUMBER, userStatus: 0, unreadMessageCount: 0, @@ -1327,8 +1326,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { isTyping: false, isImageLoading: false, image: element.eMPLOYEEIMAGE ?? "", - isImageLoaded: true, - userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), + isImageLoaded: element.eMPLOYEEIMAGE == null ? false : true, + userLocalDownlaodedImage: element.eMPLOYEEIMAGE == null ? null : await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), ), ); } diff --git a/lib/ui/chat/chat_bubble.dart b/lib/ui/chat/chat_bubble.dart index 824ab48..93fea00 100644 --- a/lib/ui/chat/chat_bubble.dart +++ b/lib/ui/chat/chat_bubble.dart @@ -1,10 +1,10 @@ -import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; -import 'package:flutter/services.dart'; -import 'package:audio_waveforms/audio_waveforms.dart' as awf; + import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:just_audio/just_audio.dart'; import 'package:mohem_flutter_app/api/chat/chat_api_client.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; @@ -16,9 +16,9 @@ import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.da import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; import 'package:mohem_flutter_app/ui/chat/chat_full_image_preview.dart'; import 'package:mohem_flutter_app/ui/chat/common.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; -import 'package:just_audio/just_audio.dart'; class ChatBubble extends StatelessWidget { ChatBubble({Key? key, required this.dateTime, required this.cItem}) : super(key: key); @@ -82,7 +82,8 @@ class ChatBubble extends StatelessWidget { Utils.hideLoading(context); await data.voiceController!.play(); } catch (e) { - Utils.showToast("Cannot open file."); + Utils.hideLoading(context); + Utils.showToast(e.toString()); } } } @@ -438,5 +439,3 @@ class ChatBubble extends StatelessWidget { ); } } - - diff --git a/lib/ui/chat/my_team_screen.dart b/lib/ui/chat/my_team_screen.dart index 6b68a58..1752295 100644 --- a/lib/ui/chat/my_team_screen.dart +++ b/lib/ui/chat/my_team_screen.dart @@ -84,24 +84,24 @@ class _MyTeamScreenState extends State { ), ), ), - Positioned( - right: 5, - bottom: 1, - child: Container( - width: 10, - height: 10, - decoration: BoxDecoration( - color: m.teamMembersList![index].userStatus == 1 ? MyColors.green2DColor : Colors.red, - ), - ).circle(10), - ) + // Positioned( + // right: 5, + // bottom: 1, + // child: Container( + // width: 10, + // height: 10, + // decoration: BoxDecoration( + // color: m.teamMembersList![index].userStatus == 1 ? MyColors.green2DColor : Colors.red, + // ), + // ).circle(10), + // ) ], ), Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - (m.teamMembersList![index].userName!.replaceFirst(".", " ").capitalizeFirstofEach ?? "").toText14(color: MyColors.darkTextColor).paddingOnly(left: 11, top: 13), + (m.teamMembersList![index].userName! ?? "").toText14(color: MyColors.darkTextColor).paddingOnly(left: 11, top: 13), ], ).expanded, // SizedBox( @@ -128,16 +128,15 @@ class _MyTeamScreenState extends State { ], ), ).onPress(() { - print(jsonEncode(m.teamMembersList[index])); - // Navigator.pushNamed( - // context, - // AppRoutes.chatDetailed, - // arguments: ChatDetailedScreenParams(m.teamMembersList![index], true), - // ).then( - // (Object? value) { - // m.clearSelections(); - // }, - // ); + Navigator.pushNamed( + context, + AppRoutes.chatDetailed, + arguments: ChatDetailedScreenParams(m.teamMembersList![index], true), + ).then( + (Object? value) { + m.clearSelections(); + }, + ); }); }, separatorBuilder: (BuildContext context, int index) => const Divider(color: MyColors.lightGreyE5Color).paddingOnly(left: 70),