Merge branch 'master' into development_mirza

merge-requests/149/head
mirza.shafique 3 years ago
commit d458e8ac45

@ -1,6 +1,7 @@
import UIKit import UIKit
import Flutter import Flutter
import Firebase import Firebase
import flutter_local_notifications
@UIApplicationMain @UIApplicationMain
@ -9,7 +10,14 @@ import Firebase
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
FirebaseApp.configure() FirebaseApp.configure()
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry)
}
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }

@ -87,13 +87,12 @@ class ApiClient {
if (!kReleaseMode) { if (!kReleaseMode) {
logger.i("res: " + response.body); logger.i("res: " + response.body);
} }
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData["MessageStatus"] == 2) { if (jsonData["IsAuthenticated"] != null) {
AppState().setIsAuthenticated = false; AppState().setIsAuthenticated = jsonData["IsAuthenticated"];
} }
if (jsonData["ErrorMessage"] == null) {
if (jsonData["ErrorMessage"] == null && jsonData["MessageStatus"] == 1) {
return factoryConstructor(jsonData); return factoryConstructor(jsonData);
} else { } else {
APIError? apiError; APIError? apiError;

@ -77,7 +77,7 @@ class AppState {
bool get getIsDemoMarathon => _isDemoMarathon; bool get getIsDemoMarathon => _isDemoMarathon;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 3.9, mobileType: Platform.isAndroid ? "android" : "ios"); final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 4.0, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() { void setPostParamsInitConfig() {
isAuthenticated = false; isAuthenticated = false;

@ -533,6 +533,9 @@ class CodegenLoader extends AssetLoader{
"startingIn": "يبدأ في", "startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة.", "youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!", "winners": "الفائزين!!!",
"expireAfter": "تنتهي بعد",
"oneWeek": "أسبوع 1",
"twoWeek": "2 أسبوع",
"noUpcoming": "لا يوجد قادم", "noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
@ -1058,6 +1061,9 @@ static const Map<String,dynamic> en_US = {
"startingIn": "Starting in", "startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.", "youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!", "winners": "WINNERS!!!",
"expireAfter": "Expires After",
"oneWeek": "1 Week",
"twoWeek": "2 Week",
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
abstract class LocaleKeys { abstract class LocaleKeys {
static const mohemm = 'mohemm'; static const mohemm = 'mohemm';
static const english = 'english'; static const english = 'english';
static const arabic = 'arabic'; static const arabic = 'arabic';
@ -250,7 +250,7 @@ abstract class LocaleKeys {
static const Payroll = 'Payroll'; static const Payroll = 'Payroll';
static const civilIdentityNumber = 'civilIdentityNumber'; static const civilIdentityNumber = 'civilIdentityNumber';
static const dateOfBirth = 'dateOfBirth'; static const dateOfBirth = 'dateOfBirth';
static const maritalStatus = 'maritalStatus '; static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName'; static const fullName = 'fullName';
static const remove = 'remove'; static const remove = 'remove';
static const submit = 'submit'; static const submit = 'submit';
@ -280,7 +280,7 @@ abstract class LocaleKeys {
static const enterNewInfo = 'enterNewInfo'; static const enterNewInfo = 'enterNewInfo';
static const endDate = 'endDate'; static const endDate = 'endDate';
static const removeThisMember = 'removeThisMember'; static const removeThisMember = 'removeThisMember';
static const wantUpdateThisMember = 'wantUpdateThisMember '; static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const addNewFamilyMember = 'addNewFamilyMember'; static const addNewFamilyMember = 'addNewFamilyMember';
static const addRow = 'addRow'; static const addRow = 'addRow';
static const pleaseSelect = 'pleaseSelect'; static const pleaseSelect = 'pleaseSelect';
@ -503,12 +503,13 @@ abstract class LocaleKeys {
static const startingIn = 'startingIn'; static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest'; static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners'; static const winners = 'winners';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const expireAfter = 'expireAfter'; static const expireAfter = 'expireAfter';
static const oneWeek = 'oneWeek'; static const oneWeek = 'oneWeek';
static const twoWeek = 'twoWeek'; static const twoWeek = 'twoWeek';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner'; static const noWinner = 'noWinner';
static const myTeam = 'myTeam'; static const myTeam = 'myTeam';
static const youCanPlayDemo = 'youCanPlayDemo'; static const youCanPlayDemo = 'youCanPlayDemo';
} }

@ -190,7 +190,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date)); accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date));
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList![0]; leaveBalanceAccrual = accrualList![0];
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0); ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;

@ -96,7 +96,7 @@ class MenusWidget extends StatelessWidget {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -123,7 +123,7 @@ class MenusWidget extends StatelessWidget {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],

@ -95,6 +95,12 @@ class _LoginScreenState extends State<LoginScreen> {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
await Firebase.initializeApp(); await Firebase.initializeApp();
// await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
// alert: true,
// badge: true,
// sound: true,
// );
// await FirebaseMessaging.instance.requestPermission();
_firebaseMessaging = FirebaseMessaging.instance; _firebaseMessaging = FirebaseMessaging.instance;
firebaseToken = await _firebaseMessaging.getToken(); firebaseToken = await _firebaseMessaging.getToken();
AppNotifications().init(firebaseToken); AppNotifications().init(firebaseToken);
@ -166,8 +172,8 @@ class _LoginScreenState extends State<LoginScreen> {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) { if (!kReleaseMode) {
// username.text = "15444"; // Maha User // username.text = "15444"; // Maha User
username.text = "15153"; // Tamer User // username.text = "15153"; // Tamer User
password.text = "Abcd@12345"; // password.text = "Abcd@12345";
// username.text = "206535"; // Hashim User // username.text = "206535"; // Hashim User
// password.text = "Namira786"; // password.text = "Namira786";

@ -324,20 +324,22 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async { Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async {
try { try {
if (isDirectLogin) if (isDirectLogin) {
setState(() { setState(() {
Utils.showLoading(context); Utils.showLoading(context);
}); });
else } else {
Utils.showLoading(context); Utils.showLoading(context);
}
await LoginApiClient().checkMobileAppVersion(); await LoginApiClient().checkMobileAppVersion();
await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!);
if (!isDirectLogin) if (!isDirectLogin) {
BasicMemberInformationModel? memberInformationModel = BasicMemberInformationModel? memberInformationModel =
await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName); await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName);
}
if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null); if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "", null);
if (!isDirectLogin) Utils.hideLoading(context); if (!isDirectLogin) Utils.hideLoading(context);
if (!isDirectLogin) if (!isDirectLogin) {
OtpDialog( OtpDialog(
context, context,
sendVerificationFlat, sendVerificationFlat,
@ -353,6 +355,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin); performApiCall(_title, _icon, _flag, sendVerificationFlat, isDirectLogin: isDirectLogin);
}, },
).displayDialog(context); ).displayDialog(context);
}
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
@ -372,6 +375,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
mobileLoginInfoListModel!.deviceToken!, mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios"); Platform.isAndroid ? "android" : "ios");
AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first; AppState().setMemberInformationListModel = genericResponseModel!.memberInformationList?.first;
AppState().setPrivilegeListModel = genericResponseModel!.privilegeList ?? [];
if (genericResponseModel.errorMessage != null) { if (genericResponseModel.errorMessage != null) {
Utils.showToast(genericResponseModel.errorMessage ?? ""); Utils.showToast(genericResponseModel.errorMessage ?? "");
// Navigator.pop(context); // Navigator.pop(context);

@ -93,7 +93,7 @@ dependencies:
flutter_webrtc: ^0.9.16 flutter_webrtc: ^0.9.16
camera: ^0.10.0+4 camera: ^0.10.0+4
flutter_local_notifications: any flutter_local_notifications: any
firebase_analytics: any #firebase_analytics: any
#Chat Voice Message Recoding & Play #Chat Voice Message Recoding & Play
audio_waveforms: ^0.1.5+1 audio_waveforms: ^0.1.5+1

Loading…
Cancel
Save