fixes & updates

merge-requests/106/head
haroon amjad 3 years ago
parent ff3c7be11f
commit a39e6808d7

@ -30,7 +30,6 @@ class MarathonApiClient {
if (marathonModel.statusCode == 200) { if (marathonModel.statusCode == 200) {
if (marathonModel.data != null && marathonModel.isSuccessful == true) { if (marathonModel.data != null && marathonModel.isSuccessful == true) {
AppState().setMarathonToken = marathonModel.data["token"] ?? ""; AppState().setMarathonToken = marathonModel.data["token"] ?? "";
print("bearer: ${AppState().getMarathonToken}");
return marathonModel.data["token"] ?? ""; return marathonModel.data["token"] ?? "";
} else { } else {
//TODO : DO ERROR HANDLING HERE //TODO : DO ERROR HANDLING HERE

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

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

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

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

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

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

@ -340,7 +340,6 @@ class Utils {
static void readNFc({required Function(String) onRead}) { static void readNFc({required Function(String) onRead}) {
NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async { NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async {
print(tag.data);
var f; var f;
if (Platform.isAndroid) { if (Platform.isAndroid) {
f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22); f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22);

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

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

@ -636,9 +636,6 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? []; AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? [];
AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first; AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first;
MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []); MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []);
genericResponseModel.privilegeList!.forEach((element) {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
});
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID; AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;

@ -242,7 +242,6 @@ class MarathonProvider extends ChangeNotifier {
selectedWinners = await MarathonApiClient().getSelectedWinner(marathonId: marathonDetailModel.id!); selectedWinners = await MarathonApiClient().getSelectedWinner(marathonId: marathonDetailModel.id!);
if (selectedWinners != null) { if (selectedWinners != null) {
selectedWinners!.removeWhere((WinnerModel element) { selectedWinners!.removeWhere((WinnerModel element) {
print("matching : ${AppState().memberInformationList!.eMPLOYEENUMBER} with ${element.employeeId}");
if (element.employeeId == AppState().memberInformationList!.eMPLOYEENUMBER) { if (element.employeeId == AppState().memberInformationList!.eMPLOYEENUMBER) {
iAmWinner = true; iAmWinner = true;
return true; return true;
@ -251,7 +250,6 @@ class MarathonProvider extends ChangeNotifier {
} }
}); });
} }
print("selectedWinners Length : ${selectedWinners!.length}");
notifyListeners(); notifyListeners();
} }

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

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

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

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

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

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

@ -352,7 +352,6 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
} }
void handleFabAction(AllowedActions action) { void handleFabAction(AllowedActions action) {
print(action.toJson());
switch (action.action) { switch (action.action) {
case "Delegate": case "Delegate":
showMyBottomSheet(context, showMyBottomSheet(context,
@ -461,7 +460,6 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
} }
void performAction(String actionMode) { void performAction(String actionMode) {
print(actionMode);
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => ITGCommentsDialog( builder: (cxt) => ITGCommentsDialog(

@ -1,4 +1,3 @@
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
@ -51,12 +50,7 @@ AppBar ChatAppBarWidget(BuildContext context,
Consumer<ChatProviderModel>( Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
if (chatUser!.isTyping!) { if (chatUser!.isTyping!) {
// return ("Typing ...").toText10(color: MyColors.textMixColor); 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)),
],
);
} else { } else {
return const SizedBox(); return const SizedBox();
} }

@ -48,8 +48,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
bool isAvailable = await NfcManager.instance.isAvailable(); bool isAvailable = await NfcManager.instance.isAvailable();
setState(() { setState(() {
AppState().privilegeListModel!.forEach((element) { AppState().privilegeListModel!.forEach((element) {
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
if (element.serviceName == "enableNFC") { if (element.serviceName == "enableNFC") {
if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true; if (isAvailable) if (element.previlege ?? false) isNfcEnabled = true;
} else if (element.serviceName == "enableQR") { } else if (element.serviceName == "enableQR") {
@ -76,7 +74,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print(MediaQuery.of(context).size.width);
return Container( return Container(
padding: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: widget.topPadding), 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), decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
@ -134,12 +131,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { 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) { if (Platform.isIOS) {
Utils.readNFc(onRead: (String nfcId) async { Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context); Utils.showLoading(context);
@ -177,7 +168,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
}); });
} else { } else {
showNfcReader(context, onNcfScan: (String? nfcId) async { showNfcReader(context, onNcfScan: (String? nfcId) async {
print(nfcId);
Utils.showLoading(context); Utils.showLoading(context);
try { try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 2, nfcValue: nfcId ?? "", isGpsRequired: isNfcLocationEnabled, lat: lat, long: lng);
@ -214,12 +204,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { 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); Utils.showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "", bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false); password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
@ -271,7 +255,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
), ),
); );
if (qrCodeValue != null) { if (qrCodeValue != null) {
print("qrCode: " + qrCodeValue);
Utils.showLoading(context); Utils.showLoading(context);
try { try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 1, isGpsRequired: isQrLocationEnabled, lat: lat, long: lng, QRValue: qrCodeValue);

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

@ -92,7 +92,7 @@ dependencies:
swipe_to: ^1.0.2 swipe_to: ^1.0.2
flutter_webrtc: ^0.9.16 flutter_webrtc: ^0.9.16
camera: ^0.10.0+4 camera: ^0.10.0+4
animated_text_kit: ^4.2.2 # animated_text_kit: ^4.2.2
#Encryption #Encryption
flutter_des: ^2.1.0 flutter_des: ^2.1.0

Loading…
Cancel
Save