Merge branch 'master' into faiz_cs

sultan-dev
Faiz Hashmi 3 years ago
commit 885a1aa377

@ -513,5 +513,6 @@
"ourSponsor": "راعينا:",
"startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!"
"winners": "الفائزين!!!",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية"
}

@ -513,6 +513,6 @@
"ourSponsor": "Our Sponsor:",
"startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!"
"winners": "WINNERS!!!",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified."
}

@ -60,17 +60,6 @@ class ChatApiClient {
json.decode(response.body),
);
} catch (e) {
// if (e.message == "api_common_unauthorized") {
// user.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
// if (userLoginResponse.response != null) {
// AppState().setchatUserDetails = userLoginResponse;
// getRecentChats();
// } else {
// Utils.showToast(
// userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr",
// );
// }
// }
throw e;
}
}
@ -97,16 +86,6 @@ class ChatApiClient {
}
return response;
} catch (e) {
// e as APIException;
// if (e.message == "api_common_unauthorized") {
// user.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
// if (userLoginResponse.response != null) {
// AppState().setchatUserDetails = userLoginResponse;
// getSingleUserChatHistory(senderUID: senderUID, receiverUID: receiverUID, loadMore: loadMore, paginationVal: paginationVal);
// } else {
// Utils.showToast(userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr");
// }
// }
throw e;
}
}
@ -135,15 +114,6 @@ class ChatApiClient {
return favoriteChatUser;
} catch (e) {
e as APIException;
// if (e.message == "api_common_unauthorized") {
// user.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
// if (userLoginResponse.response != null) {
// AppState().setchatUserDetails = userLoginResponse;
// unFavUser(userID: userID, targetUserID: targetUserID);
// } else {
// Utils.showToast(userLoginResponse.errorResponses!.first.fieldName.toString() + " Erorr");
// }
// }
throw e;
}
}

@ -133,6 +133,28 @@ class DashboardApiClient {
}, url, postParams);
}
//Mark Fake Location
Future<GenericResponseModel?> markFakeLocation({String lat = "0", String? long = "0", required String sourceName}) async {
String url = "${ApiConsts.swpRest}CreateIssueInfo";
var uuid = Uuid();
// Generate a v4 (random) id
Map<String, dynamic> postParams = {
"UID": uuid.v4(), //Mobile Id
"Latitude": lat,
"Longitude": long,
"QRValue": '',
"NFCValue": sourceName == 'NFC' ? sourceName : '',
"WifiValue": sourceName == 'WIFI' ? sourceName : '',
"EmployeeID": AppState().memberInformationList!.eMPLOYEENUMBER,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
}, url, postParams);
}
//Check ITG Type
Future<MohemmItgResponseItem?> getITGPageNotification() async {
String url = "${ApiConsts.cocRest}Mohemm_ITG_GetPageNotification";

@ -29,7 +29,6 @@ class MonthlyAttendanceApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null;
}, url, postParams);
}
@ -49,7 +48,6 @@ class MonthlyAttendanceApiClient {
// postParams["DeviceType"] = deviceType;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData.getDayHoursTypeDetailsList!.length);
return responseData.getDayHoursTypeDetailsList ?? [];
}, url, postParams);
}

@ -19,7 +19,6 @@ class MonthlyPaySlipApiClient {
String url = "${ApiConsts.erpRest}GET_PAYSLIP";
Map<String, dynamic> postParams = {"P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": -999};
postParams.addAll(AppState().postParamsJson);
print(postParams);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.getPayslipList ?? [];

@ -26,7 +26,6 @@ class MyAttendanceApiClient {
if (empID!.isNotEmpty) {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
// AppState().postParamsJson['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
print(empID);
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);

@ -64,7 +64,6 @@ class MyTeamApiClient {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData.getDayHoursTypeDetailsList!.length);
return responseData.getDayHoursTypeDetailsList ?? [];
}, url, postParams);
}
@ -76,7 +75,6 @@ class MyTeamApiClient {
postParams['P_SELECTED_EMPLOYEE_NUMBER'] = empID;
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData.getAttendanceTrackingList);
return responseData.getAttendanceTrackingList;
}, url, postParams);
}

@ -41,7 +41,6 @@ class ProfileApiClient {
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return responseData.getEmployeeContactsList ?? [];
}, url, postParams);
}
@ -258,7 +257,6 @@ class ProfileApiClient {
// "EITTransactionTBLModel": list,
};
postParams.addAll(AppState().postParamsJson);
print("postParams:$postParams");
postParams["EITTransactionTBL"] = list;
postParams["EITTransactionTBLModel"] = list;
return await ApiClient().postJsonForObject((json) {
@ -300,7 +298,6 @@ class ProfileApiClient {
// "EITTransactionTBLModel": list,
};
postParams.addAll(AppState().postParamsJson);
print("postParams:$postParams");
postParams["EITTransactionTBL"] = list;
// postParams["EITTransactionTBLModel"] = list;
return await ApiClient().postJsonForObject((json) {
@ -389,12 +386,7 @@ class ProfileApiClient {
};
postParams.addAll(AppState().postParamsJson);
print("postParam:${json.encode(postParams)}");
postParams["EITTransactionTBL"] = list;
list.forEach((element) {
print(json.encode(element));
});
return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
return responseData.submitContactTransactionList;

@ -46,9 +46,6 @@ class TerminationDffApiClient {
};
postParams.addAll(AppState().postParamsJson);
for (var abc in list) {
print(abc);
}
return await ApiClient().postJsonForObject((json) {
GenericResponseModel genericResponseModel = GenericResponseModel.fromJson(json);
return genericResponseModel.submitTermTransactionList!;

@ -26,6 +26,7 @@ import 'package:mohem_flutter_app/models/update_user_item_type_list.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
@ -509,6 +510,20 @@ class WorkListApiClient {
}, url, postParams);
}
Future<List<GetAddressNotificationBodyList>?> getAddressNotificationBodyList(int? notificationId) async {
String url = "${ApiConsts.erpRest}GET_ADDRESS_NOTIFICATION_BODY";
Map<String, dynamic> postParams = {
"P_NOTIFICATION_ID": notificationId,
"P_PAGE_LIMIT": 100,
"P_PAGE_NUM": 1,
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData.getAddressNotificationBodyList;
}, url, postParams);
}
Future<List<GetFavoriteReplacements>?> getFavoriteReplacementWithoutImage() async {
String url = "${ApiConsts.erpRest}Mohemm_GetFavoriteReplacementsWithoutImage";
Map<String, dynamic> postParams = {};

@ -9,7 +9,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.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/date_uitl.dart';
import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/exceptions/api_exception.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -66,6 +65,7 @@ class Utils {
showDialog(
context: context,
barrierColor: Colors.black.withOpacity(0.5),
useRootNavigator: false,
builder: (BuildContext context) => LoadingDialog(),
).then((value) {
_isLoadingVisible = false;
@ -121,8 +121,11 @@ class Utils {
),
);
} else {
showToast(errorMessage);
// confirmDialog(cxt, errorMessage);
if (cxt != null) {
confirmDialog(cxt, errorMessage);
} else {
showToast(errorMessage);
}
}
}
}
@ -340,7 +343,6 @@ class Utils {
static void readNFc({required Function(String) onRead}) {
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
print(tag.data);
var f;
if (Platform.isAndroid) {
f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22);

@ -102,13 +102,14 @@ extension EmailValidator on String {
decoration: isUnderLine ? TextDecoration.underline : null),
);
Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines}) => Text(
Widget toText16({Color? color, bool isUnderLine = false, bool isBold = false, int? maxlines, double? height}) => Text(
this,
maxLines: maxlines,
style: TextStyle(
color: color ?? MyColors.darkTextColor,
fontSize: 16,
letterSpacing: -0.64,
height: height,
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
decoration: isUnderLine ? TextDecoration.underline : null,
),

@ -528,7 +528,9 @@ class CodegenLoader extends AssetLoader{
"youWantToLeaveMarathon": "هل أنت متأكد أنك تريد العودة؟ سوف تخرج من المسابقة.",
"ourSponsor": "راعينا:",
"startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة."
"youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية"
};
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
@ -1044,7 +1046,9 @@ static const Map<String,dynamic> en_US = {
"youWantToLeaveMarathon": "Are you sure you want to go back? You will be out of the contest.",
"ourSponsor": "Our Sponsor:",
"startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest."
"youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified."
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -500,5 +500,6 @@ abstract class LocaleKeys {
static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners';
static const fakeLocation = 'fakeLocation';
}

@ -102,6 +102,7 @@ import 'package:mohem_flutter_app/models/validate_eit_transaction_list_model.dar
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
@ -163,12 +164,12 @@ class GenericResponseModel {
List<String>? getAbsenceAttachmentsList;
List<GetAbsenceAttendanceTypesList>? getAbsenceAttendanceTypesList;
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList;
List<GetAbsenceDffStructureList>? getAbsenceDffStructureList;
List<GetAbsenceTransactionList>? getAbsenceTransactionList;
List<GetAccrualBalancesList>? getAccrualBalancesList;
List<GetActionHistoryList>? getActionHistoryList;
List<GetAddressDffStructureList>? getAddressDffStructureList;
List<String>? getAddressNotificationBodyList;
List<GetApprovesList>? getApprovesList;
List<GetAttachementList>? getAttachementList;
GetAttendanceTracking? getAttendanceTrackingList;
@ -717,6 +718,13 @@ class GenericResponseModel {
});
}
if (json['GetAddressNotificationBodyList'] != null) {
getAddressNotificationBodyList = <GetAddressNotificationBodyList>[];
json['GetAddressNotificationBodyList'].forEach((v) {
getAddressNotificationBodyList!.add(GetAddressNotificationBodyList.fromJson(v));
});
}
if (json['GetAbsenceDffStructureList'] != null) {
getAbsenceDffStructureList = <GetAbsenceDffStructureList>[];
json['GetAbsenceDffStructureList'].forEach((v) {
@ -746,7 +754,7 @@ class GenericResponseModel {
getAddressDffStructureList!.add(GetAddressDffStructureList.fromJson(v));
});
}
getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
// getAddressNotificationBodyList = json['GetAddressNotificationBodyList'];
if (json['GetApprovesList'] != null) {
getApprovesList = <GetApprovesList>[];

@ -0,0 +1,28 @@
class GetAddressNotificationBodyList {
String? pREVSEGMENTVALUEDSP;
String? sEGMENTPROMPT;
String? sEGMENTVALUEDSP;
String? uPDATEDFLAG;
GetAddressNotificationBodyList(
{this.pREVSEGMENTVALUEDSP,
this.sEGMENTPROMPT,
this.sEGMENTVALUEDSP,
this.uPDATEDFLAG});
GetAddressNotificationBodyList.fromJson(Map<String, dynamic> json) {
pREVSEGMENTVALUEDSP = json['PREV_SEGMENT_VALUE_DSP'];
sEGMENTPROMPT = json['SEGMENT_PROMPT'];
sEGMENTVALUEDSP = json['SEGMENT_VALUE_DSP'];
uPDATEDFLAG = json['UPDATED_FLAG'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['PREV_SEGMENT_VALUE_DSP'] = this.pREVSEGMENTVALUEDSP;
data['SEGMENT_PROMPT'] = this.sEGMENTPROMPT;
data['SEGMENT_VALUE_DSP'] = this.sEGMENTVALUEDSP;
data['UPDATED_FLAG'] = this.uPDATEDFLAG;
return data;
}
}

@ -36,6 +36,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
String chatCID = '';
bool isLoading = true;
bool isChatScreenActive = false;
int receiverID = 0;
late File selectedFile;
bool isFileSelected = false;
String sFileType = "";
@ -46,7 +48,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool currentUserTyping = false;
int? cTypingUserId = 0;
//Chat
//Chat Home Page Counter
int chatUConvCounter = 0;
Future<void> getUserAutoLoginToken() async {
@ -142,6 +144,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
if (isNewChat) userChatHistory = [];
if (!loadMore) paginationVal = 0;
isChatScreenActive = true;
receiverID = receiverUID;
Response response = await ChatApiClient().getSingleUserChatHistory(senderUID: senderUID, receiverUID: receiverUID, loadMore: loadMore, paginationVal: paginationVal);
if (response.statusCode == 204) {
if (isNewChat) {
@ -160,7 +163,9 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isLoading = false;
notifyListeners();
markRead(userChatHistory, receiverUID);
if (isChatScreenActive && receiverUID == receiverID) {
markRead(userChatHistory, receiverUID);
}
generateConvId();
}
@ -286,14 +291,12 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void chatNotDelivered(List<Object?>? args) {
dynamic items = args!.toList();
for (dynamic item in items[0]) {
searchedChats!.forEach(
(ChatUser element) {
if (element.id == item["currentUserId"]) {
int? val = element.unreadMessageCount ?? 0;
element.unreadMessageCount = val! + 1;
}
},
);
for (ChatUser element in searchedChats!) {
if (element.id == item["currentUserId"]) {
int? val = element.unreadMessageCount ?? 0;
element.unreadMessageCount = val! + 1;
}
}
}
notifyListeners();
}
@ -371,20 +374,27 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
}
setMsgTune();
userChatHistory.insert(0, data.first);
if (searchedChats != null && !isChatScreenActive) {
for (ChatUser user in searchedChats!) {
if (user.id == data.first.currentUserId) {
int tempCount = user.unreadMessageCount ?? 0;
user.unreadMessageCount = tempCount + 1;
if (isChatScreenActive && data.first.currentUserId == receiverID) {
userChatHistory.insert(0, data.first);
} else {
if (searchedChats != null) {
for (ChatUser user in searchedChats!) {
if (user.id == data.first.currentUserId) {
int tempCount = user.unreadMessageCount ?? 0;
user.unreadMessageCount = tempCount + 1;
}
}
sort();
}
sort();
}
List list = [
{"userChatHistoryId": data.first.userChatHistoryId, "TargetUserId": temp.first.targetUserId, "isDelivered": true, "isSeen": isChatScreenActive ? true : false}
List<Object> list = [
{
"userChatHistoryId": data.first.userChatHistoryId,
"TargetUserId": temp.first.targetUserId,
"isDelivered": true,
"isSeen": isChatScreenActive && data.first.currentUserId == receiverID ? true : false
}
];
updateUserChatHistoryOnMsg(list);
invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
@ -393,9 +403,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void sort() {
searchedChats!.sort(
(ChatUser a, ChatUser b) => b.unreadMessageCount!.compareTo(
a.unreadMessageCount!,
),
(ChatUser a, ChatUser b) => b.unreadMessageCount!.compareTo(a.unreadMessageCount!),
);
}
@ -533,28 +541,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void sendChatMessage(BuildContext context, {required int targetUserId, required int userStatus, required String userEmail, required String targetUserName}) async {
dynamic contain = searchedChats!.where((ChatUser element) => element.id == targetUserId);
if (contain.isEmpty) {
List<String> emails = [];
emails.add(await EmailImageEncryption().encrypt(val: userEmail));
List<ChatUserImageModel> chatImages = await ChatApiClient().getUsersImages(encryptedEmails: emails);
searchedChats!.add(
ChatUser(
id: targetUserId,
userName: targetUserName,
unreadMessageCount: 0,
email: userEmail,
isImageLoading: false,
image: chatImages.first.profilePicture ?? "",
isImageLoaded: true,
isTyping: false,
isFav: false,
userStatus: userStatus,
userLocalDownlaodedImage: await downloadImageLocal(chatImages.first.profilePicture, targetUserId.toString()),
),
);
notifyListeners();
}
if (!isFileSelected && !isMsgReply) {
print("Normal Text Msg");
if (message.text == null || message.text.isEmpty) {
@ -614,6 +600,51 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isImageLoaded: true,
image: selectedFile.readAsBytesSync());
}
if (searchedChats != null) {
dynamic contain = searchedChats!.where((ChatUser element) => element.id == targetUserId);
if (contain.isEmpty) {
List<String> emails = [];
emails.add(await EmailImageEncryption().encrypt(val: userEmail));
List<ChatUserImageModel> chatImages = await ChatApiClient().getUsersImages(encryptedEmails: emails);
searchedChats!.add(
ChatUser(
id: targetUserId,
userName: targetUserName,
unreadMessageCount: 0,
email: userEmail,
isImageLoading: false,
image: chatImages.first.profilePicture ?? "",
isImageLoaded: true,
isTyping: false,
isFav: false,
userStatus: userStatus,
userLocalDownlaodedImage: await downloadImageLocal(chatImages.first.profilePicture, targetUserId.toString()),
),
);
notifyListeners();
}
} else {
List<String> emails = [];
emails.add(await EmailImageEncryption().encrypt(val: userEmail));
List<ChatUserImageModel> chatImages = await ChatApiClient().getUsersImages(encryptedEmails: emails);
searchedChats!.add(
ChatUser(
id: targetUserId,
userName: targetUserName,
unreadMessageCount: 0,
email: userEmail,
isImageLoading: false,
image: chatImages.first.profilePicture ?? "",
isImageLoaded: true,
isTyping: false,
isFav: false,
userStatus: userStatus,
userLocalDownlaodedImage: await downloadImageLocal(chatImages.first.profilePicture, targetUserId.toString()),
),
);
notifyListeners();
}
}
void selectImageToUpload(BuildContext context) {
@ -718,7 +749,10 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
for (ChatUser user in searchedChats!) {
if (user.id == favoriteChatUser.response!.targetUserId!) {
user.isFav = favoriteChatUser.response!.isFav;
favUsersList.add(user);
dynamic contain = favUsersList!.where((ChatUser element) => element.id == favoriteChatUser.response!.targetUserId!);
if (contain.isEmpty) {
favUsersList.add(user);
}
}
}
}
@ -746,6 +780,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
searchedChats = pChatHistory;
search.clear();
isChatScreenActive = false;
receiverID = 0;
paginationVal = 0;
message.text = '';
isFileSelected = false;
@ -756,14 +791,47 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void clearAll() {
print("----------------- Disposed ---------------------------");
searchedChats = pChatHistory;
search.clear();
isChatScreenActive = false;
receiverID = 0;
paginationVal = 0;
message.text = '';
isFileSelected = false;
repliedMsg = [];
sFileType = "";
}
void disposeData() {
search.clear();
isChatScreenActive = false;
receiverID = 0;
paginationVal = 0;
message.text = '';
isFileSelected = false;
repliedMsg = [];
sFileType = "";
deleteData();
favUsersList.clear();
searchedChats!.clear();
pChatHistory!.clear();
chatHubConnection.stop();
AppState().chatDetails = null;
}
void deleteData() {
List<ChatUser> exists = [], unique = [];
exists.addAll(searchedChats!);
exists.addAll(favUsersList!);
Map<String, ChatUser> profileMap = {};
for (ChatUser item in exists) {
profileMap[item.email!] = item;
}
unique = profileMap.values.toList();
for (ChatUser element in unique!) {
deleteFile(element.id.toString());
}
}
void getUserImages() async {
@ -868,7 +936,6 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void onNewChatConversion(List<Object?>? params) {
dynamic items = params!.toList();
logger.d(items);
chatUConvCounter = items[0]["singleChatCount"] ?? 0;
notifyListeners();
}
@ -877,4 +944,9 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
await chatHubConnection.invoke("GetChatCounversationCount", args: [userId]);
return "";
}
void userTypingInvoke({required int currentUser, required int reciptUser}) async {
logger.d([reciptUser, currentUser]);
await chatHubConnection.invoke("UserTypingAsync", args: [reciptUser, currentUser]);
}
}

@ -101,21 +101,29 @@ class ChatBubble extends StatelessWidget {
],
),
),
).paddingOnly(right: 5, bottom: 7),
).paddingOnly(bottom: 7),
if (fileTypeID == 12 || fileTypeID == 4 || fileTypeID == 3)
showImage(isReplyPreview: false, fileName: cItem.contant!, fileTypeDescription: cItem.fileTypeResponse!.fileTypeDescription).paddingOnly(right: 5).onPress(() {
showDialog(
context: context,
anchorPoint: screenOffset,
builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant!, img: cItem.image!),
);
})
ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: SizedBox(
height: 140,
width: 227,
child: showImage(isReplyPreview: false, fileName: cItem.contant!, fileTypeDescription: cItem.fileTypeResponse!.fileTypeDescription).onPress(() {
showDialog(
context: context,
anchorPoint: screenOffset,
builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant!, img: cItem.image!),
);
}),
),
).paddingOnly(bottom: 4)
else
Row(
children: [
if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 || fileTypeID == 2)
SvgPicture.asset(data.getType(fileTypeName ?? ""), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 0, right: 10),
(cItem.contant ?? "").toText12().expanded,
if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 || fileTypeID == 2) const Icon(Icons.remove_red_eye, size: 16)
],
),
Align(
@ -132,12 +140,12 @@ class ChatBubble extends StatelessWidget {
),
),
],
).paddingOnly(top: 11, left: 13, right: 7, bottom: 5).objectContainerView(disablePadding: true).paddingOnly(left: MediaQuery.of(context).size.width * 0.3);
).paddingOnly(top: 11, left: 13, right: 13, bottom: 5).objectContainerView(disablePadding: true).paddingOnly(left: MediaQuery.of(context).size.width * 0.3);
}
Widget receiptUser(BuildContext context) {
return Container(
padding: const EdgeInsets.only(top: 11, left: 13, right: 7, bottom: 5),
padding: const EdgeInsets.only(top: 11, left: 13, right: 13, bottom: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
gradient: const LinearGradient(
@ -190,29 +198,36 @@ class ChatBubble extends StatelessWidget {
],
),
),
).paddingOnly(right: 5, bottom: 7),
).paddingOnly(bottom: 7),
if (fileTypeID == 12 || fileTypeID == 4 || fileTypeID == 3)
showImage(isReplyPreview: false, fileName: cItem.contant ?? "", fileTypeDescription: cItem.fileTypeResponse!.fileTypeDescription ?? "image/jpg").paddingOnly(right: 5).onPress(() {
showDialog(
context: context,
anchorPoint: screenOffset,
builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant ?? "", img: cItem.image!),
);
})
ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: SizedBox(
height: 140,
width: 227,
child: showImage(isReplyPreview: false, fileName: cItem.contant ?? "", fileTypeDescription: cItem.fileTypeResponse!.fileTypeDescription ?? "image/jpg").onPress(() {
showDialog(
context: context,
anchorPoint: screenOffset,
builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant ?? "", img: cItem.image!),
);
}),
),
).paddingOnly(bottom: 4)
else
Row(
children: [
if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 || fileTypeID == 2)
SvgPicture.asset(data.getType(fileTypeName ?? ""), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(
left: 0,
right: 10,
),
SvgPicture.asset(data.getType(fileTypeName ?? ""), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 0, right: 10),
(cItem.contant ?? "").toText12(color: Colors.white).expanded,
if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 || fileTypeID == 2) const Icon(Icons.remove_red_eye, color: Colors.white, size: 16)
],
),
Align(
alignment: Alignment.centerRight,
child: dateTime.toText10(color: Colors.white.withOpacity(.71),),
child: dateTime.toText10(
color: Colors.white.withOpacity(.71),
),
),
],
),
@ -220,12 +235,15 @@ class ChatBubble extends StatelessWidget {
}
Widget showImage({required bool isReplyPreview, required String fileName, required String fileTypeDescription}) {
if (isReplyPreview) {}
if (cItem.isImageLoaded! && cItem.image != null) {
return Image.memory(
cItem.image!,
height: isReplyPreview ? 32 : 140,
width: isReplyPreview ? 32 : 227,
fit: BoxFit.cover,
alignment: Alignment.center,
);
} else {
return FutureBuilder<Uint8List>(
@ -233,7 +251,7 @@ class ChatBubble extends StatelessWidget {
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState != ConnectionState.waiting) {
if (snapshot.data == null) {
return SizedBox();
return const SizedBox();
} else {
cItem.image = snapshot.data;
cItem.isImageLoaded = true;
@ -242,6 +260,7 @@ class ChatBubble extends StatelessWidget {
height: isReplyPreview ? 32 : 140,
width: isReplyPreview ? 32 : 227,
fit: BoxFit.cover,
alignment: Alignment.center,
);
}
} else {

@ -85,14 +85,14 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
showTyping: true,
chatUser: params!.chatUser,
actions: [
SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() {
// makeCall(callType: "AUDIO", con: hubConnection);
}),
24.width,
SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() {
// makeCall(callType: "VIDEO", con: hubConnection);
}),
21.width,
// SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() {
// // makeCall(callType: "AUDIO", con: hubConnection);
// }),
// 24.width,
// SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() {
// // makeCall(callType: "VIDEO", con: hubConnection);
// }),
// 21.width,
],
),
body: SafeArea(
@ -233,6 +233,9 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
),
).paddingOnly(right: 21),
),
onChanged: (val) {
m.userTypingInvoke(currentUser: AppState().chatDetails!.response!.id!, reciptUser: params!.chatUser!.id!);
},
),
],
));

@ -47,6 +47,7 @@ class _ChatHomeState extends State<ChatHome> {
return;
}
if (data.searchedChats == null || data.searchedChats!.isEmpty) {
data.isLoading = true;
data.getUserRecentChats();
}
}

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -139,11 +137,11 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
children: [
(m.searchedChats![index].userName!.replaceFirst(".", " ").capitalizeFirstofEach ?? "").toText14(color: MyColors.darkTextColor).paddingOnly(left: 11, top: 13),
m.searchedChats![index].isTyping!
? AnimatedTextKit(
animatedTexts: [
ScaleAnimatedText('Typing...', textStyle: const TextStyle(color: MyColors.textMixColor, fontSize: 10, letterSpacing: -0.4, fontStyle: FontStyle.normal)),
],
).paddingOnly(left: 11)
? 'Typing...'
.toText10(
color: MyColors.textMixColor,
)
.paddingOnly(left: 11.0)
: const SizedBox()
//(m.searchedChats![index].isTyping! ? "Typing ..." : "").toText10(color: MyColors.textMixColor).paddingOnly(left: 11, top: 0),
],

@ -200,7 +200,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height,
Row(

@ -41,8 +41,6 @@ class _TodayAttendanceScreenState extends State<TodayAttendanceScreen> {
bool isAvailable = await NfcManager.instance.isAvailable();
setState(() {
AppState().privilegeListModel!.forEach((element) {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
if (element.serviceName == "enableNFC") {
if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true;
} else if (element.serviceName == "enableQR") {

@ -11,6 +11,7 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/drawer_menu_item_model.dart';
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/business_card_dialog.dart';
import 'package:mohem_flutter_app/ui/dialogs/id/employee_digital_id_dialog.dart';
@ -28,6 +29,13 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> {
List<DrawerMenuItem> drawerMenuItemList = [];
late ChatProviderModel chatData;
@override
void initState() {
super.initState();
chatData = Provider.of<ChatProviderModel>(context, listen: false);
}
@override
Widget build(BuildContext context) {
@ -171,6 +179,7 @@ class _AppDrawerState extends State<AppDrawer> {
AppState().isAuthenticated = false;
AppState().isLogged = false;
AppState().setPostParamsInitConfig();
chatData.disposeData();
// SharedPreferences prefs = await SharedPreferences.getInstance();
// await prefs.clear();
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: null);

@ -289,7 +289,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
),
_title.toText16()
_title.toText16(height: 20/16)
],
),
),

@ -572,7 +572,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
width: 38,
color: isDisable ? MyColors.darkTextColor.withOpacity(0.7) : null,
),
_title.toText16()
_title.toText16(height: 20/16)
],
),
),
@ -636,9 +636,6 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? [];
AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first;
MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []);
genericResponseModel.privilegeList!.forEach((element) {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
});
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;

@ -110,9 +110,9 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
String dESCFLEXCONTEXTCODE = "";
String descFlexConTextTitle = "";
Future calGetValueSetValues(GetEITDFFStructureList structureList) async {
Future calGetValueSetValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async {
try {
Utils.showLoading(context);
if (showLoading) Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSVSSplited?.length ?? 0); i++) {
List<Map<String, dynamic>> values = [];
String segmentId = structureList.cHILDSEGMENTSVSSplited![i];
@ -140,18 +140,21 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
// getEitDffStructureList = genericResponseModel?.getEITDFFStructureList ?? [];
//getEitDffStructureList = getEitDffStructureList!.where((element) => element.dISPLAYFLAG != "N").toList();
}
await Future.delayed(const Duration(seconds: 1));
Utils.hideLoading(context);
if (showLoading) {
await Future.delayed(const Duration(seconds: 1));
Utils.hideLoading(context);
}
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
if (showLoading) Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
Future getDefaultValues(GetEITDFFStructureList structureList) async {
Future getDefaultValues(GetEITDFFStructureList structureList, {bool showLoading = true}) async {
try {
Utils.showLoading(context);
if (showLoading) Utils.showLoading(context);
for (int i = 0; i < (structureList.cHILDSEGMENTSDVSplited?.length ?? 0); i++) {
String segmentId = structureList.cHILDSEGMENTSDVSplited![i];
GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
@ -176,8 +179,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
GetEITDFFStructureList defaultValueCheck = getEitDffStructureList!.where((GetEITDFFStructureList element) => element.sEGMENTNAME == segmentId).toList().first;
if (defaultValueCheck.cHILDSEGMENTSDVSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
getDefaultValues(defaultValueCheck);
Utils.hideLoading(context);
await getDefaultValues(defaultValueCheck, showLoading: false);
// GetEITDFFStructureList? parent = getEitDffStructureList!.firstWhere((element) => element.sEGMENTNAME == segmentId);
// List<Map<String, dynamic>> getSetList = getDefaultValuesIonicLogic(parent);
@ -185,19 +187,23 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
// int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
// getEitDffStructureList![index].eSERVICESDV = defaultValue;
} else if (defaultValueCheck.cHILDSEGMENTSVSSplited!.isNotEmpty && defaultValueCheck.rEADONLY == 'Y') {
calGetValueSetValues(defaultValueCheck);
Utils.hideLoading(context);
await calGetValueSetValues(defaultValueCheck, showLoading: false);
// Utils.hideLoading(context);
}
} else if (values.isNotEmpty) {
ESERVICESDV defaultValue = await MyAttendanceApiClient().getDefaultValue(segmentId, structureList.dESCFLEXCONTEXTCODE!, structureList.dESCFLEXNAME!, values);
int index = getEitDffStructureList!.indexWhere((element) => element.sEGMENTNAME == segmentId);
getEitDffStructureList![index].eSERVICESDV = defaultValue;
}
}
await Future.delayed(const Duration(seconds: 1));
Utils.hideLoading(context);
if (showLoading) {
await Future.delayed(const Duration(seconds: 1));
Utils.hideLoading(context);
}
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
if (showLoading) Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
@ -331,7 +337,7 @@ class _DynamicInputScreenState extends State<DynamicInputScreen> {
idColName = val;
if (getEitDffStructureList![j].fORMATTYPE == "X") {
idColName = Utils.formatDateNew(idColName!);
idColName = Utils.formatDateDefault(idColName!);
// commenting to test
// DateTime date = DateFormat('yyyy-MM-dd').parse(idColName!);
// idColName = DateFormat('yyyy-MM-dd HH:mm:ss').format(date);

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_layout_grid/flutter_layout_grid.dart';
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
@ -22,7 +23,8 @@ class DynamicListViewParams {
List<CollectionNotificationEit>? collectionNotificationList;
final String selectedEmp;
DynamicListViewParams(this.title, this.dynamicId, {this.selectedEmp ='', this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.isUpdate = false, this.collectionNotificationList});
DynamicListViewParams(this.title, this.dynamicId,
{this.selectedEmp = '', this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.isUpdate = false, this.collectionNotificationList});
}
class DynamicListViewScreen extends StatefulWidget {
@ -37,6 +39,7 @@ class DynamicListViewScreen extends StatefulWidget {
class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
List<GetEITTransactionList>? getEITTransactionList;
DynamicListViewParams? dynamicParams;
// String? empId;
@override
@ -99,47 +102,19 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
: ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
? const SizedBox()
: GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.0 / 0.75),
padding: const EdgeInsets.only(left: 12,right: 21,top: 12),
shrinkWrap: true,
primary: false,
physics: const ScrollPhysics(),
children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
).objectContainerView(),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
// if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
// // GridView(
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
// // shrinkWrap: true,
// // primary: false,
// // physics: const ScrollPhysics(),
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
// // )
// // ItemDetailViewCol(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
//
// // GridView(
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
// // shrinkWrap: true,
// // primary: false,
// // physics: const ScrollPhysics(),
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
// // )
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
// ],
// ).objectContainerView(),
itemBuilder: (cxt, int parentIndex) {
if (getEITTransactionList![parentIndex].collectionTransaction!.isEmpty) {
return const SizedBox();
}
int count = getEITTransactionList![parentIndex].collectionTransaction!.length;
return LayoutGrid(
columnSizes: [1.fr, 1.fr],
rowSizes: [for (int i = 0; i < (count / 2).round(); i++) auto],
columnGap: 8,
rowGap: 12,
children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
).objectContainerView();
},
separatorBuilder: (cxt, index) => 12.height,
itemCount: getEITTransactionList!.length)),
],

@ -44,13 +44,12 @@ class _BasicDetailsState extends State<BasicDetails> {
super.initState();
memberInformationList = AppState().memberInformationList!;
List<GetMenuEntriesList> menuData = Provider.of<DashboardProviderModel>(context, listen: false).getMenuEntriesList!;
for( int i=0;i<menuData.length;i++) {
for (int i = 0; i < menuData.length; i++) {
menuData[i].icon == "";
print(menuData[i].requestType);
}
var filterList = menuData.where((e) => e.requestType == 'BASIC_DETAILS').toList();
if(filterList.isNotEmpty) {
if (filterList.isNotEmpty) {
menuEntries = filterList.first;
}

@ -37,7 +37,6 @@ class _DeleteFamilyMemberState extends State<DeleteFamilyMember> {
//int? relationId;
@override
void initState() {
print(widget.relationId);
super.initState();
}

@ -294,7 +294,6 @@ class _DynamicInputScreenState extends State<DynamicInputScreenAddress> {
countryCode,
effectiveDate.isEmpty ? DateFormat('dd-MMM-yyy').format(DateTime.now()) : effectiveDate,
);
print(values);
Utils.hideLoading(context);
Navigator.pushNamed(context, AppRoutes.requestSubmitScreen,

@ -39,7 +39,6 @@ class _ItemsForSaleFragmentState extends State<ItemsForSaleFragment> {
if (gridScrollController.position.atEdge) {
bool isTop = gridScrollController.position.pixels == 0;
if (!isTop && getItemsForSaleList.length == currentPageNo * 10) {
print('At the bottom');
currentPageNo++;
getItemsForSale(currentPageNo, currentCategoryID);
}

@ -193,7 +193,6 @@ class _MyPostedAdsFragmentState extends State<MyPostedAdsFragment> {
Utils.hideLoading(context);
Utils.handleException(e, context, null);
});
print(response.statusCode);
Utils.hideLoading(context);
getAdsByEmployee();
}

@ -255,7 +255,6 @@ class _EndEmploymentScreenState extends State<EndEmploymentScreen> {
],
onSelected: (int popipIndex) async {
termColObject.selectedObjectValue = termColObject.objectValuesList![popipIndex];
print(termColObject.selectedObjectValue?.toJson());
setState(() {});
});
}

@ -352,7 +352,6 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
void handleFabAction(AllowedActions action) {
print(action.toJson());
switch (action.action) {
case "Delegate":
showMyBottomSheet(context,
@ -461,7 +460,6 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}
void performAction(String actionMode) {
print(actionMode);
showDialog(
context: context,
builder: (cxt) => ITGCommentsDialog(
@ -535,7 +533,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
Utils.hideLoading(context);
Utils.showToast(LocaleKeys.yourChangeHasBeenSavedSuccessfully.tr());
// Navigator.pop(context, "delegate_reload");
animationIndex=animationIndex+1;
animationIndex = animationIndex + 1;
AppState().requestAllList!.removeAt(AppState().itgWorkListIndex!);
if (AppState().requestAllList!.isEmpty) {
Navigator.pop(context, "delegate_reload");

@ -215,11 +215,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
title: LocaleKeys.workList.tr(),
showNotificationButton: true,
),
appBar: AppBarWidget(context, title: LocaleKeys.workList.tr(), showWorkListSettingButton: true),
body: SizedBox(
width: double.infinity,
height: double.infinity,
@ -284,31 +280,33 @@ class _WorkListScreenState extends State<WorkListScreen> {
physics: const BouncingScrollPhysics(),
child: itgRequestTypeIndex != null
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 40,
child: ListView.separated(
itemBuilder: (context, index) {
RequestType type = itgFormsModel!.requestType![index];
return Container(
padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
).onPress(() {
if (itgRequestTypeIndex != index) {
itgRequestTypeIndex = index;
setState(() {});
}
});
},
separatorBuilder: (context, index) => 8.width,
shrinkWrap: true,
itemCount: itgFormsModel?.requestType?.length ?? 0,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.only(left: 21, right: 21),
),
).paddingOnly(top: 16, bottom: 16),
// todo this is commented for temporary purpose, have issue when selecting any itg category and click any item showing wrong details
// SizedBox(
// height: 40,
// child: ListView.separated(
// itemBuilder: (context, index) {
// RequestType type = itgFormsModel!.requestType![index];
// return Container(
// padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
// alignment: Alignment.center,
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: itgRequestTypeIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
// child: ("${type.requestTypeName}").toText12(color: itgRequestTypeIndex == index ? MyColors.white : MyColors.black),
// ).onPress(() {
// if (itgRequestTypeIndex != index) {
// itgRequestTypeIndex = index;
// setState(() {});
// }
// });
// },
// separatorBuilder: (context, index) => 8.width,
// shrinkWrap: true,
// itemCount: itgFormsModel?.requestType?.length ?? 0,
// scrollDirection: Axis.horizontal,
// padding: const EdgeInsets.only(left: 21, right: 21),
// ),
// ).paddingOnly(top: 16, bottom: 16),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
@ -429,7 +427,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
void openBottomSheet(BuildContext context) {
showMyBottomSheet(
context,
callBackFunc: (){},
callBackFunc: () {},
child: WorkListAdvanceSearch((selectedViewID, selectedItemTypeID, searchByInput, searchByDate) async {
itgRequestTypeIndex = null;
pNotificationType = selectedViewID;

@ -25,6 +25,7 @@ import 'package:mohem_flutter_app/models/member_information_list_model.dart';
import 'package:mohem_flutter_app/models/notification_get_respond_attributes_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/GetRFCEmployeeList.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
@ -78,6 +79,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
List<GetBasicDetNtfBodyList>? getBasicDetNtfBodyList = [];
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList = [];
GetContactNotificationBodyList? getContactNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
GenericResponseModel? getBasicNTFBody;
GenericResponseModel? getICBody;
@ -118,6 +121,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getBasicDetNtfBodyList!.clear();
getAbsenceCollectionNotificationBodyList!.clear();
getContactNotificationBodyList = null;
getAddressNotificationBodyList!.clear();
if (workListData!.iTEMTYPE == "HRSSA" || workListData!.iTEMTYPE == "STAMP") {
getUserInformation();
@ -139,6 +143,8 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getAbsenceNotificationBody();
} else if (workListData!.rEQUESTTYPE == "CONTACT") {
getContactNotificationBody();
} else if (workListData!.rEQUESTTYPE == "ADDRESS") {
getAddressNotificationBody();
}
// getBasicNTFBody = await WorkListApiClient().getBasicDetNTFBody(workListData!.nOTIFICATIONID!, -999);
// getAbsenceCollectionNotifications = await WorkListApiClient().getAbsenceNotificationBody(workListData!.nOTIFICATIONID!, -999);
@ -271,6 +277,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getEitCollectionNotificationBodyList: getEitCollectionNotificationBodyList,
getPhonesNotificationBodyList: getPhonesNotificationBodyList,
getBasicDetNtfBodyList: getBasicDetNtfBodyList,
getAddressNotificationBodyList: getAddressNotificationBodyList,
getAbsenceCollectionNotificationBodyList: getAbsenceCollectionNotificationBodyList,
getContactNotificationBodyList: getContactNotificationBodyList,
getPrNotificationBodyList: getPrNotificationBody,
@ -429,6 +436,12 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
case "DELEGATE":
returnActionImage = "assets/images/delegate.svg";
break;
case "APPROVE":
returnActionImage = "assets/images/worklist/approve.svg";
break;
case "REJECT":
returnActionImage = "assets/images/worklist/reject.svg";
break;
case "REQUEST_INFO":
returnActionImage = "assets/images/request_info.svg";
break;
@ -841,6 +854,23 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
}
void getAddressNotificationBody() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);
apiCallCount++;
getAddressNotificationBodyList = await WorkListApiClient().getAddressNotificationBodyList(workListData!.nOTIFICATIONID);
apiCallCount--;
if (apiCallCount == 0) {
Utils.hideLoading(context);
setState(() {});
}
} catch (ex) {
apiCallCount--;
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
}
void getStampNotificationBody() async {
try {
if (apiCallCount == 0) Utils.showLoading(context);

@ -13,6 +13,7 @@ import 'package:mohem_flutter_app/models/get_pr_notification_body_list_model.dar
import 'package:mohem_flutter_app/models/get_stamp_ms_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/get_stamp_ns_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/eit_otification_body_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_address_notification_body_list.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_basic_det_ntf_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_contact_notification_body_list_model.dart';
import 'package:mohem_flutter_app/models/worklist/hr/get_phones_notification_body_list_model.dart';
@ -31,6 +32,7 @@ class InfoFragment extends StatelessWidget {
List<GetAbsenceCollectionNotificationBodyList>? getAbsenceCollectionNotificationBodyList;
GetContactNotificationBodyList? getContactNotificationBodyList;
GetPrNotificationBodyList? getPrNotificationBodyList;
List<GetAddressNotificationBodyList>? getAddressNotificationBodyList = [];
InfoFragment(
{this.workListData,
@ -43,7 +45,8 @@ class InfoFragment extends StatelessWidget {
this.getBasicDetNtfBodyList,
this.getAbsenceCollectionNotificationBodyList,
this.getContactNotificationBodyList,
this.getPrNotificationBodyList});
this.getPrNotificationBodyList,
this.getAddressNotificationBodyList});
double itemHeight = 0;
double itemWidth = 0;
@ -89,6 +92,7 @@ class InfoFragment extends StatelessWidget {
if (getBasicDetNtfBodyList?.isNotEmpty ?? false) getBasicDetNtfBodyListWidget(getBasicDetNtfBodyList ?? []).objectContainerView(title: "Basic Information"),
if (getAbsenceCollectionNotificationBodyList?.isNotEmpty ?? false) getAbsenceCollectionNotificationBodyListWidget(getAbsenceCollectionNotificationBodyList ?? []),
if (getContactNotificationBodyList != null) getContactNotificationBodyListWidget(getContactNotificationBodyList ?? GetContactNotificationBodyList()).objectContainerView(),
if (getAddressNotificationBodyList?.isNotEmpty ?? false) getAddressNotificationBodyListWidget(getAddressNotificationBodyList!),
];
return Container(
width: double.infinity,
@ -160,7 +164,7 @@ class InfoFragment extends StatelessWidget {
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.otherCharges.tr(), poHeaderList[index].oTHERCHARGES?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].qUOTATIONDATE ?? ""),
ItemDetailViewCol(LocaleKeys.totalPOAmountWithVAT.tr(), poHeaderList[index].tOTPOAMT.toString() ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.totalPOAmountInWords.tr(), poHeaderList[index].tOTPOAMTWORD ?? ""),
@ -465,6 +469,36 @@ class InfoFragment extends StatelessWidget {
);
}
Widget getAddressNotificationBodyListWidget(List<GetAddressNotificationBodyList> getAddressNotificationBodyList) {
bool isOdd = false;
try {
if (getAddressNotificationBodyList.length % 2 != 0) {
isOdd = true;
getAddressNotificationBodyList.add(GetAddressNotificationBodyList(sEGMENTPROMPT: "--", sEGMENTVALUEDSP: "--"));
}
} catch (e) {}
return GridView.builder(
itemCount: getAddressNotificationBodyList!.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => ItemDetailViewGridItem(
index,
getAddressNotificationBodyList[index].sEGMENTPROMPT,
getAddressNotificationBodyList[index].sEGMENTVALUEDSP,
isNeedToShowEmptyDivider: (getAddressNotificationBodyList.length == index + 1)
? isOdd
? true
: false
: false,
),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
),
).objectContainerView();
}
List<Widget> getPRHeaderValues() {
List<Widget> pRHeaders = [];
getPrNotificationBodyList!.pRHeader!.forEach((element) {
@ -478,7 +512,7 @@ class InfoFragment extends StatelessWidget {
try {
if (data.contactNotificationBody!.length % 2 != 0) {
isOdd = true;
data.contactNotificationBody!.add(new ContactNotificationBody());
data.contactNotificationBody!.add(ContactNotificationBody(segmentPrompt: "--", segmentValueDsp: "--"));
}
} catch (e) {}

@ -58,10 +58,10 @@ class RequestFragment extends StatelessWidget {
children: [
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.code.tr(), poLinesList[index].iTEMCODE ?? ""),
ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].uOM ?? ""),
ItemDetailViewCol(LocaleKeys.mfg.tr(), poLinesList[index].mFG ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].qUANTITY?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.lineType.tr(), poLinesList[index].lINETYPE?.toString() ?? ""),
ItemDetailViewCol(LocaleKeys.unit.tr(), poLinesList[index].uOM ?? ""),
),
ItemDetailGrid(
@ -78,10 +78,10 @@ class RequestFragment extends StatelessWidget {
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.deliverToLocation.tr(), poLinesList[index].dELIVERTOLOCATION ?? ""),
ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].rEQUESTOR ?? ""),
ItemDetailViewCol(LocaleKeys.requisitionNumber.tr(), poLinesList[index].pRNUM ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].pRNUM ?? ""),
ItemDetailViewCol(LocaleKeys.requester.tr(), poLinesList[index].rEQUESTOR ?? ""),
Container(),
),
12.height,

@ -12,7 +12,7 @@ import 'package:provider/provider.dart';
AppBar AppBarWidget(BuildContext context,
{required String title,
bool showHomeButton = true,
bool showNotificationButton = false,
bool showWorkListSettingButton = false,
bool showMemberButton = false,
List<Widget>? actions,
void Function()? onHomeTapped,
@ -43,12 +43,12 @@ AppBar AppBarWidget(BuildContext context,
},
icon: const Icon(Icons.home, color: MyColors.darkIconColor),
),
if (showNotificationButton)
if (showWorkListSettingButton)
IconButton(
onPressed: () {
Navigator.pushNamed(context, AppRoutes.worklistSettings);
},
icon: const Icon(Icons.notifications, color: MyColors.textMixColor),
icon: const Icon(Icons.settings_rounded, color: MyColors.darkIconColor),
),
if (showMemberButton)
IconButton(

@ -1,4 +1,3 @@
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -51,12 +50,7 @@ AppBar ChatAppBarWidget(BuildContext context,
Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
if (chatUser!.isTyping!) {
// return ("Typing ...").toText10(color: MyColors.textMixColor);
return AnimatedTextKit(
animatedTexts: [
ScaleAnimatedText('Typing...', textStyle: const TextStyle(color: MyColors.textMixColor, fontSize: 10, letterSpacing: -0.4, fontStyle: FontStyle.normal)),
],
);
return ("Typing ...").toText10(color: MyColors.textMixColor);
} else {
return const SizedBox();
}

@ -68,11 +68,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
readOnly: isReadOnly,
keyboardType: (isInputTypeNum)
? isInputTypeNumSigned
? const TextInputType.numberWithOptions(signed: true)
: TextInputType.number
: TextInputType.text,
keyboardType: (isInputTypeNum) ? (isInputTypeNumSigned ? const TextInputType.numberWithOptions(signed: true, decimal: true) : TextInputType.numberWithOptions(signed: true, decimal: true)) : TextInputType.text,
textInputAction: TextInputAction.done,
//controller: controller,
maxLines: lines,

@ -36,10 +36,11 @@ class ItemDetailViewCol extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6), maxLine: 2),
4.width,
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 2),
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 5),
],
);
}

@ -46,12 +46,12 @@ class Location {
});
}
static void getCurrentLocation(Function(LatLng?) callback, BuildContext context) {
static void getCurrentLocation(Function(LatLng?, bool isMocked) callback, BuildContext context) {
void done(Position position) {
//AppStorage.sp.saveLocation(position);
bool isMocked = position.isMocked;
LatLng? myCurrentLocation = LatLng(position.latitude, position.longitude);
callback(myCurrentLocation);
callback(myCurrentLocation, isMocked);
}
AppPermissions.location((granted) {

@ -48,8 +48,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
bool isAvailable = await NfcManager.instance.isAvailable();
setState(() {
AppState().privilegeListModel!.forEach((element) {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
if (element.serviceName == "enableNFC") {
if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true;
} else if (element.serviceName == "enableQR") {
@ -76,7 +74,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
@override
Widget build(BuildContext context) {
print(MediaQuery.of(context).size.width);
return Container(
padding: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: widget.topPadding),
decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
@ -97,8 +94,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
// if (isNfcEnabled)
attendanceMethod("NFC", "assets/images/nfc.svg", isNfcEnabled, () {
if (isNfcLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performNfcAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("NFC", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performNfcAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
performNfcAttendance(widget.model);
@ -107,8 +108,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isWifiEnabled)
attendanceMethod("Wifi", "assets/images/wufu.svg", isWifiEnabled, () {
if (isWifiLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performWifiAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("WIFI", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performWifiAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
performWifiAttendance(widget.model);
@ -118,8 +123,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
if (isQrEnabled)
attendanceMethod("QR", "assets/images/ic_qr.svg", isQrEnabled, () async {
if (isQrLocationEnabled) {
Location.getCurrentLocation((LatLng? latlng) {
performQrCodeAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
Location.getCurrentLocation((LatLng? latlng, bool isMocked) {
if (isMocked) {
markFakeAttendance("QR", latlng?.latitude.toString() ?? "", latlng?.longitude.toString() ?? "");
} else {
performQrCodeAttendance(widget.model, lat: latlng?.latitude.toString() ?? "", lng: latlng?.longitude.toString() ?? "");
}
}, context);
} else {
performQrCodeAttendance(widget.model);
@ -134,18 +143,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
}
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (isNfcLocationEnabled) {
print("nfc location enabled");
} else {
print("nfc not location enabled");
}
if (Platform.isIOS) {
Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId, isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
if(g?.messageStatus != 1) {
if (g?.messageStatus != 1) {
Utils.hideLoading(context);
showDialog(
context: context,
@ -166,7 +169,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
child: SuccessDialog(widget.isFromDashboard),
);
}
} catch (ex) {
print(ex);
Utils.hideLoading(context);
@ -177,11 +179,10 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
});
} else {
showNfcReader(context, onNcfScan: (String? nfcId) async {
print(nfcId);
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
if(g?.messageStatus != 1) {
if (g?.messageStatus != 1) {
Utils.hideLoading(context);
showDialog(
context: context,
@ -214,12 +215,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
}
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (isWifiLocationEnabled) {
print("wifi location enabled");
} else {
print("wifi not location enabled");
}
Utils.showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
@ -271,7 +266,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
),
);
if (qrCodeValue != null) {
print("qrCode: " + qrCodeValue);
Utils.showLoading(context);
try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue);
@ -293,6 +287,21 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
}
}
void markFakeAttendance(String sourceName, String lat, String long) async {
Utils.showLoading(context);
try {
await DashboardApiClient().markFakeLocation(sourceName: sourceName, lat: lat, long: long);
Utils.hideLoading(context);
Utils.confirmDialog(context, LocaleKeys.fakeLocation.tr());
} catch (ex) {
print(ex);
Utils.hideLoading(context);
Utils.handleException(ex, context, (msg) {
Utils.confirmDialog(context, msg);
});
}
}
Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),

@ -41,7 +41,6 @@ class _NfcLayoutState extends State<NfcLayout> {
super.initState();
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
print(tag.data);
var f;
if (Platform.isAndroid) {
f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22);

@ -68,7 +68,7 @@ dependencies:
month_picker_dialog_2: 0.5.5
open_file: ^3.2.1
wifi_iot: ^0.3.16
flutter_html: ^2.2.1
flutter_html: ^3.0.0-alpha.6
# flutter_barcode_scanner: ^2.0.0
qr_code_scanner: ^1.0.0
qr_flutter: ^4.0.0
@ -92,7 +92,7 @@ dependencies:
swipe_to: ^1.0.2
flutter_webrtc: ^0.9.16
camera: ^0.10.0+4
animated_text_kit: ^4.2.2
# animated_text_kit: ^4.2.2
#Encryption
flutter_des: ^2.1.0
@ -100,6 +100,7 @@ dependencies:
video_player: ^2.4.7
just_audio: ^0.9.30
safe_device: ^1.1.2
flutter_layout_grid: ^2.0.1
dev_dependencies:
flutter_test:

Loading…
Cancel
Save