diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 6679cbb..900fd4a 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -3,8 +3,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; class ApiConsts { //static String baseUrl = "http://10.200.204.20:2801/"; // Local server // static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server - static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server - // static String baseUrl = "https://hmgwebservices.com"; // Live server + //static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server + static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrlServices = baseUrl + "/Services/"; // server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 24c4532..f46b958 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -330,6 +330,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { user.userStatus = items.first["userStatus"]; } } + + notifyListeners(); } @@ -1292,45 +1294,52 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { print("=============== In App State ====================="); getEmployeeSubordinatesList = AppState().getemployeeSubordinatesList; for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) { - print(element.eMPLOYEEEMAILADDRESS); - teamMembersList.add( - ChatUser( - id: int.parse(element.eMPLOYEENUMBER!), - email: element.eMPLOYEEEMAILADDRESS, - userName: element.eMPLOYEEDISPLAYNAME, - phone: element.eMPLOYEEMOBILENUMBER, - userStatus: 0, - unreadMessageCount: 0, - isFav: false, - isTyping: false, - isImageLoading: false, - image: element.eMPLOYEEIMAGE ?? "", - isImageLoaded: true, - userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), - ), - ); + if (element.eMPLOYEEEMAILADDRESS != null) { + if (element.eMPLOYEEEMAILADDRESS!.isNotEmpty) { + teamMembersList.add( + ChatUser( + id: int.parse(element.eMPLOYEENUMBER!), + email: element.eMPLOYEEEMAILADDRESS, + userName: element.eMPLOYEEDISPLAYNAME, + phone: element.eMPLOYEEMOBILENUMBER, + userStatus: 0, + unreadMessageCount: 0, + isFav: false, + isTyping: false, + isImageLoading: false, + image: element.eMPLOYEEIMAGE ?? "", + isImageLoaded: true, + userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), + ), + ); + } + } } } else { getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates("", "", ""); AppState().setemployeeSubordinatesList = getEmployeeSubordinatesList; for (GetEmployeeSubordinatesList element in getEmployeeSubordinatesList) { print(element.eMPLOYEEEMAILADDRESS); - teamMembersList.add( - ChatUser( - id: int.parse(element.eMPLOYEENUMBER!), - email: element.eMPLOYEEEMAILADDRESS, - userName: element.eMPLOYEEDISPLAYNAME, - phone: element.eMPLOYEEMOBILENUMBER, - userStatus: 0, - unreadMessageCount: 0, - isFav: false, - isTyping: false, - isImageLoading: false, - image: element.eMPLOYEEIMAGE ?? "", - isImageLoaded: true, - userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), - ), - ); + if (element.eMPLOYEEEMAILADDRESS != null) { + if (element.eMPLOYEEEMAILADDRESS!.isNotEmpty) { + teamMembersList.add( + ChatUser( + id: int.parse(element.eMPLOYEENUMBER!), + email: element.eMPLOYEEEMAILADDRESS, + userName: element.eMPLOYEEDISPLAYNAME, + phone: element.eMPLOYEEMOBILENUMBER, + userStatus: 0, + unreadMessageCount: 0, + isFav: false, + isTyping: false, + isImageLoading: false, + image: element.eMPLOYEEIMAGE ?? "", + isImageLoaded: true, + userLocalDownlaodedImage: await downloadImageLocal(element.eMPLOYEEIMAGE ?? "", element.eMPLOYEENUMBER!), + ), + ); + } + } } } isLoading = false; diff --git a/lib/ui/chat/my_team_screen.dart b/lib/ui/chat/my_team_screen.dart index 6b68a58..3f59ab2 100644 --- a/lib/ui/chat/my_team_screen.dart +++ b/lib/ui/chat/my_team_screen.dart @@ -128,16 +128,16 @@ 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(); - // }, - // ); + // print(jsonEncode(m.teamMembersList[index])); + 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),