Merge branch 'master' into development_aamir

# Conflicts:
#	lib/provider/chat_provider_model.dart
#	lib/ui/chat/my_team_screen.dart
merge-requests/126/head
Aamir Muhammad 2 years ago
commit 407899a602

@ -10,7 +10,7 @@
"client_info": { "client_info": {
"mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f",
"android_client_info": { "android_client_info": {
"package_name": "com.cloudSolutions.mohemmtest" "package_name": "hmg.cloudSolutions.mohem"
} }
}, },
"oauth_client": [ "oauth_client": [

@ -29,6 +29,7 @@ class MarathonApiClient {
(json) { (json) {
MarathonGenericModel marathonModel = MarathonGenericModel.fromJson(json); MarathonGenericModel marathonModel = MarathonGenericModel.fromJson(json);
AppState().setMarathonToken = marathonModel.data["token"] ?? ""; AppState().setMarathonToken = marathonModel.data["token"] ?? "";
print("marathonToken: ${"AppState(): ${AppState().getMarathonToken}"}");
return marathonModel.data["token"] ?? ""; return marathonModel.data["token"] ?? "";
}, },
ApiConsts.marathonParticipantLoginUrl, ApiConsts.marathonParticipantLoginUrl,

@ -82,6 +82,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
Future<void> buildHubConnection() async { Future<void> buildHubConnection() async {
chatHubConnection = await getHubConnection(); chatHubConnection = await getHubConnection();
await chatHubConnection.start(); await chatHubConnection.start();
if (kDebugMode) { if (kDebugMode) {
@ -172,7 +173,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
if (isNewChat) { if (isNewChat) {
userChatHistory = []; userChatHistory = [];
} else if (loadMore) { } else if (loadMore) {
Utils.showToast("No More Data To Load");
} }
} else { } else {
if (loadMore) { if (loadMore) {
@ -1298,7 +1299,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
teamMembersList = []; teamMembersList = [];
isLoading = true; isLoading = true;
if (AppState().getemployeeSubordinatesList.isNotEmpty) { if (AppState().getemployeeSubordinatesList.isNotEmpty) {
print("=============== In App State =====================");
getEmployeeSubordinatesList = AppState().getemployeeSubordinatesList; getEmployeeSubordinatesList = AppState().getemployeeSubordinatesList;
for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) { for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) {
if (element.eMPLOYEEEMAILADDRESS != null) { if (element.eMPLOYEEEMAILADDRESS != null) {
@ -1307,7 +1307,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
ChatUser( ChatUser(
id: int.parse(element.eMPLOYEENUMBER!), id: int.parse(element.eMPLOYEENUMBER!),
email: element.eMPLOYEEEMAILADDRESS, email: element.eMPLOYEEEMAILADDRESS,
userName: element.eMPLOYEEDISPLAYNAME, userName: element.eMPLOYEENAME,
phone: element.eMPLOYEEMOBILENUMBER, phone: element.eMPLOYEEMOBILENUMBER,
userStatus: 0, userStatus: 0,
unreadMessageCount: 0, unreadMessageCount: 0,
@ -1315,8 +1315,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isTyping: false, isTyping: false,
isImageLoading: false, isImageLoading: false,
image: element.eMPLOYEEIMAGE ?? "", image: element.eMPLOYEEIMAGE ?? "",
isImageLoaded: true, isImageLoaded: element.eMPLOYEEIMAGE == null ? false : true,
userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), userLocalDownlaodedImage: element.eMPLOYEEIMAGE == null ? null : await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!),
), ),
); );
} }
@ -1326,14 +1326,13 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates("", "", ""); getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates("", "", "");
AppState().setemployeeSubordinatesList = getEmployeeSubordinatesList; AppState().setemployeeSubordinatesList = getEmployeeSubordinatesList;
for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) { for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) {
print(element.eMPLOYEEEMAILADDRESS);
if (element.eMPLOYEEEMAILADDRESS != null) { if (element.eMPLOYEEEMAILADDRESS != null) {
if (element.eMPLOYEEEMAILADDRESS!.isNotEmpty) { if (element.eMPLOYEEEMAILADDRESS!.isNotEmpty) {
teamMembersList.add( teamMembersList.add(
ChatUser( ChatUser(
id: int.parse(element.eMPLOYEENUMBER!), id: int.parse(element.eMPLOYEENUMBER!),
email: element.eMPLOYEEEMAILADDRESS, email: element.eMPLOYEEEMAILADDRESS,
userName: element.eMPLOYEEDISPLAYNAME, userName: element.eMPLOYEENAME,
phone: element.eMPLOYEEMOBILENUMBER, phone: element.eMPLOYEEMOBILENUMBER,
userStatus: 0, userStatus: 0,
unreadMessageCount: 0, unreadMessageCount: 0,
@ -1341,8 +1340,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isTyping: false, isTyping: false,
isImageLoading: false, isImageLoading: false,
image: element.eMPLOYEEIMAGE ?? "", image: element.eMPLOYEEIMAGE ?? "",
isImageLoaded: true, isImageLoaded: element.eMPLOYEEIMAGE == null ? false : true,
userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), userLocalDownlaodedImage: element.eMPLOYEEIMAGE == null ? null : await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!),
), ),
); );
} }

@ -1,10 +1,10 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:typed_data'; 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/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.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/api/chat/chat_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.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/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/ui/chat/chat_full_image_preview.dart'; import 'package:mohem_flutter_app/ui/chat/chat_full_image_preview.dart';
import 'package:mohem_flutter_app/ui/chat/common.dart'; import 'package:mohem_flutter_app/ui/chat/common.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
import 'package:just_audio/just_audio.dart';
class ChatBubble extends StatelessWidget { class ChatBubble extends StatelessWidget {
ChatBubble({Key? key, required this.dateTime, required this.cItem}) : super(key: key); ChatBubble({Key? key, required this.dateTime, required this.cItem}) : super(key: key);
@ -82,7 +82,8 @@ class ChatBubble extends StatelessWidget {
Utils.hideLoading(context); Utils.hideLoading(context);
await data.voiceController!.play(); await data.voiceController!.play();
} catch (e) { } catch (e) {
Utils.showToast("Cannot open file."); Utils.hideLoading(context);
Utils.showToast(e.toString());
} }
} }
} }
@ -438,5 +439,3 @@ class ChatBubble extends StatelessWidget {
); );
} }
} }

@ -128,7 +128,6 @@ class _MyTeamScreenState extends State<MyTeamScreen> {
], ],
), ),
).onPress(() { ).onPress(() {
// print(jsonEncode(m.teamMembersList[index]));
Navigator.pushNamed( Navigator.pushNamed(
context, context,
AppRoutes.chatDetailed, AppRoutes.chatDetailed,

@ -435,7 +435,6 @@ class MarathonProvider extends ChangeNotifier {
} }
bool checkIfPrivilegedForMarathon() { bool checkIfPrivilegedForMarathon() {
return true;
for (PrivilegeListModel element in AppState().privilegeListModel!) { for (PrivilegeListModel element in AppState().privilegeListModel!) {
if (element.serviceName == "Marathon") { if (element.serviceName == "Marathon") {
if (element.previlege != null) { if (element.previlege != null) {
@ -451,20 +450,18 @@ class MarathonProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
isPrivilegedWithMarathon = checkIfPrivilegedForMarathon(); isPrivilegedWithMarathon = checkIfPrivilegedForMarathon();
if (isPrivilegedWithMarathon) { if (isPrivilegedWithMarathon) {
await MarathonApiClient().getMarathonToken().whenComplete(() async { marathonDetailModel = await MarathonApiClient().getMarathonDetails();
marathonDetailModel = await MarathonApiClient().getMarathonDetails(); updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30;
updateTotalSecondsToWaitForMarathon = marathonDetailModel.marathonBufferTime ?? 30; if (marathonDetailModel.id == null) {
if (marathonDetailModel.id == null) { isUpComingMarathon = false;
isUpComingMarathon = false; isLoading = false;
isLoading = false; notifyListeners();
notifyListeners(); return;
return; }
} if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) {
if (DateTime.parse(marathonDetailModel.startTime!).isAfter(DateTime.now())) { itsMarathonTime = false;
itsMarathonTime = false; }
} populateQuestionStatusesList();
populateQuestionStatusesList();
});
} }
isLoading = false; isLoading = false;
notifyListeners(); notifyListeners();

@ -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. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1 version: 3.1.5+300015
environment: environment:
sdk: ">=2.16.0 <3.0.0" sdk: ">=2.16.0 <3.0.0"

Loading…
Cancel
Save