Merge branch 'development_haroon' into 'master'

Development haroon

See merge request Cloud_Solution/mohemm-flutter-app!145
merge-requests/146/head
haroon amjad 3 years ago
commit 0a85e37a5a

@ -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;

@ -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);

Loading…
Cancel
Save