logins apis

flutter_upgrade_with_timesheet_changes
Aamir Muhammad 4 months ago
parent 72c178382f
commit cd36d61640

@ -1,25 +1,12 @@
def localProperties = new Properties() plugins {
def localPropertiesFile = rootProject.file('local.properties') id "com.android.application"
if (localPropertiesFile.exists()) { id "kotlin-android"
localPropertiesFile.withReader('UTF-8') { reader -> id "com.google.gms.google-services"
localProperties.load(reader) id "dev.flutter.flutter-gradle-plugin"
} id "com.google.firebase.crashlytics"
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
} }
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties') def keystorePropertiesFile = rootProject.file('key.properties')
@ -27,19 +14,11 @@ if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} }
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion 34
compileOptions { android {
sourceCompatibility JavaVersion.VERSION_1_8 namespace 'hmg.cloudSolutions.mohem'
targetCompatibility JavaVersion.VERSION_1_8 compileSdk 36
}
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
@ -52,10 +31,10 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "hmg.cloudSolutions.mohem" applicationId "hmg.cloudSolutions.mohem"
minSdkVersion 28 minSdkVersion 30
targetSdkVersion 34 targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutter.versionCode
versionName flutterVersionName versionName flutter.versionName
} }
signingConfigs { signingConfigs {
@ -84,5 +63,5 @@ flutter {
} }
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20"
} }

@ -1,34 +1,110 @@
buildscript { //buildscript {
ext.kotlin_version = '1.9.10' // ext.kotlin_version = '1.9.10'
// repositories {
// google()
// mavenCentral()
// maven { url 'https://developer.huawei.com/repo/' }
// }
//
// dependencies {
// classpath 'com.android.tools.build:gradle:7.1.3'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath 'com.google.gms:google-services:4.3.8'
// classpath 'com.huawei.agconnect:agcp:1.8.0.300'
// classpath "com.android.tools:r8:8.2.33"
// }
//}
//
//allprojects {
// repositories {
// google()
// mavenCentral()
// maven { url 'https://developer.huawei.com/repo/' }
// }
//}
//
//rootProject.buildDir = '../build'
//subprojects {
// project.buildDir = "${rootProject.buildDir}/${project.name}"
// project.evaluationDependsOn(':app')
//}
//
//tasks.register("clean", Delete) {
// delete rootProject.buildDir
//}
allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://developer.huawei.com/repo/' } maven {
url 'https://developer.huawei.com/repo/'
}
maven {
url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local"
}
} }
dependencies { // Exclude old BouncyCastle globally to avoid duplicate classes
classpath 'com.android.tools.build:gradle:7.1.3' configurations.all {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" exclude group: 'org.bouncycastle', module: 'bcprov-jdk16'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.huawei.agconnect:agcp:1.8.0.300'
classpath "com.android.tools:r8:8.2.33"
} }
}
allprojects { tasks.withType(JavaCompile).configureEach {
repositories { sourceCompatibility = JavaVersion.VERSION_21
google() targetCompatibility = JavaVersion.VERSION_21
mavenCentral() }
maven { url 'https://developer.huawei.com/repo/' }
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "21"
}
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
buildFeatures {
if (buildConfig == null) {
buildConfig true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}
}
// Force Java 17 for all JavaCompile tasks in all subprojects (including plugins)
project.tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
// Force Kotlin JVM target for all subprojects
project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "21"
}
}
}
} }
} }
rootProject.buildDir = '../build' rootProject.buildDir = '../build'
subprojects { subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}" project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
tasks.register("clean", Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.layout.buildDirectory
} }

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048M org.gradle.jvmargs=-Xmx2048M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.java.home=/Users/user/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/ #org.gradle.java.home=/Users/amirs/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/

@ -1,6 +1,6 @@
#Thu Mar 06 11:40:30 AST 2025 #Tue Jul 08 11:08:34 AST 2025
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

@ -1,11 +1,44 @@
include ':app' pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists() includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk") repositories {
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" google()
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" mavenCentral()
gradlePluginPortal()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://developer.huawei.com/repo/' }
maven {
url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local"
}
}
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.11.0' apply false
id("org.jetbrains.kotlin.android") version "2.2.0" apply false
id("com.google.gms.google-services") version "4.4.3" apply false
id("com.google.firebase.crashlytics") version "3.0.4" apply false
id('org.gradle.toolchains.foojay-resolver-convention') version '0.9.0' apply false
}
include ":app"

@ -144,7 +144,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */, C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */,
EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */, 6C6E76E4FB19FAF11C24005D /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -242,6 +242,23 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
6C6E76E4FB19FAF11C24005D /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1; alwaysOutOfDate = 1;
@ -274,23 +291,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */

@ -26,6 +26,7 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
@ -43,11 +44,13 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">

@ -1,6 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:http/http.dart' as http;
import 'package:mohem_flutter_app/api/api_client.dart'; import 'package:mohem_flutter_app/api/api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/consts.dart'; import 'package:mohem_flutter_app/classes/consts.dart';
@ -12,7 +14,8 @@ import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_main_response.dart'; import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:platform_device_id/platform_device_id.dart'; import 'package:mohem_flutter_app/models/sso_auth_model.dart';
import 'package:platform_device_id_plus/platform_device_id.dart';
// import 'package:platform_device_id/platform_device_id.dart'; // import 'package:platform_device_id/platform_device_id.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
@ -153,6 +156,59 @@ class DashboardApiClient {
); );
} }
Future<GenericResponseModel?> getTicketBookingRedirection() async {
String url = "${ApiConsts.erpRest}GET_PORTAL_REDIRECTION";
Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
},
url,
postParams,
);
}
Future<SSOAuthModel?> getBookingSSOAuthRedirection({required String clientID}) async {
String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm";
//https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm'
// Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
Map<String, dynamic> postParams = {
"ClientId": clientID,
// "ClientId": "a9f4d1a0596d4aea8f830992ec4bdac1",
"PersonId": AppState().memberInformationList?.eMPLOYEENUMBER,
"Username": AppState().memberInformationList?.eMPLOYEENUMBER,
"Language": "en",
};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
SSOAuthModel responseData = SSOAuthModel.fromJson(json);
return responseData;
},
url,
postParams,
);
}
Future<dynamic> getBookingSSOFinalRedirection({required String token}) async {
token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
var request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG'));
request.fields.addAll({'JWTToken': token});
// request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 302) {
print("================== post ==========");
var res = await response.stream.bytesToString();
return response.headers["location"];
} else {
print(response.reasonPhrase);
}
}
//Mark Attendance //Mark Attendance
Future<GenericResponseModel?> markAttendance({ Future<GenericResponseModel?> markAttendance({
String lat = "0", String lat = "0",

@ -6,12 +6,12 @@ class ApiConsts {
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024"; // static String baseUrl = "http://10.201.204.101:2024";
static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server // static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server // static String baseUrl = "https://mohemm.hmg.com"; // New Live server
// //
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.20.200.111:1010/"; // static String baseUrl = "http://10.20.200.111:1010/";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd // static String baseUrl = "https://webservices.hmg.com"; // PreProd
@ -27,6 +27,8 @@ class ApiConsts {
static String user = baseUrlServices + "api/User/"; static String user = baseUrlServices + "api/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/"; static String cocRest = baseUrlServices + "COCWS.svc/REST/";
static String ssoAuthRedirection = "https://sso-uat.hmg.com/api/auth/connect";
//Chat //Chat
static String chatServerBaseUrl = "https://apiderichat.hmg.com/"; static String chatServerBaseUrl = "https://apiderichat.hmg.com/";
static String chatServerBaseApiUrl = chatServerBaseUrl + "api/"; static String chatServerBaseApiUrl = chatServerBaseUrl + "api/";

@ -0,0 +1,33 @@
import 'dart:developer';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser {
final Function onExitCallback;
final Function(String) onLoadStartCallback;
MyInAppBrowser({
required this.onExitCallback,
required this.onLoadStartCallback,
});
@override
Future onBrowserCreated() async {
log("\n\nBrowser Created!\n\n");
}
@override
Future onLoadStart(Uri? url) async {
onLoadStartCallback(url.toString());
}
@override
Future onLoadStop(Uri? url) async {
log("\n\nStopped $url\n\n");
}
@override
void onLoadError(Uri? url, int code, String message) {
log("Can't load $url.. Error: $message");
}
}

@ -31,13 +31,14 @@ class Utils {
static void showToast(String message, {bool longDuration = true}) { static void showToast(String message, {bool longDuration = true}) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, msg: message,
toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT, toastLength: longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM, gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1, timeInSecForIosWeb: 1,
backgroundColor: Colors.black54, backgroundColor: Colors.black54,
textColor: Colors.white, textColor: Colors.white,
fontSize: 13.0); fontSize: 13.0,
);
} }
static dynamic getNotNullValue(List<dynamic> list, int index) { static dynamic getNotNullValue(List<dynamic> list, int index) {
@ -63,12 +64,7 @@ class Utils {
static void showLoading(BuildContext context) { static void showLoading(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
_isLoadingVisible = true; _isLoadingVisible = true;
showDialog( showDialog(context: context, barrierColor: Colors.black.withOpacity(0.5), useRootNavigator: false, builder: (BuildContext context) => LoadingDialog()).then((value) {
context: context,
barrierColor: Colors.black.withOpacity(0.5),
useRootNavigator: false,
builder: (BuildContext context) => LoadingDialog(),
).then((value) {
_isLoadingVisible = false; _isLoadingVisible = false;
}); });
}); });
@ -118,13 +114,14 @@ class Utils {
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: cxt, context: cxt,
builder: (cxt) => ConfirmDialog( builder:
message: errorMessage, (cxt) => ConfirmDialog(
onTap: () { message: errorMessage,
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false); onTap: () {
}, Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false);
onCloseTap: () {}, },
), onCloseTap: () {},
),
); );
} else { } else {
if (cxt != null) { if (cxt != null) {
@ -138,33 +135,18 @@ class Utils {
} }
static Future showErrorDialog({required BuildContext context, required VoidCallback onOkTapped, required String message}) async { static Future showErrorDialog({required BuildContext context, required VoidCallback onOkTapped, required String message}) async {
return showDialog( return showDialog(context: context, builder: (BuildContext context) => ConfirmDialog(message: message, onTap: onOkTapped));
context: context,
builder: (BuildContext context) => ConfirmDialog(
message: message,
onTap: onOkTapped,
),
);
} }
static void confirmDialog(cxt, String message, {VoidCallback? onTap}) { static void confirmDialog(cxt, String message, {VoidCallback? onTap}) {
showDialog( showDialog(context: cxt, builder: (BuildContext cxt) => ConfirmDialog(message: message, onTap: onTap));
context: cxt,
builder: (BuildContext cxt) => ConfirmDialog(
message: message,
onTap: onTap,
),
);
} }
static Widget getNoDataWidget(BuildContext context) { static Widget getNoDataWidget(BuildContext context) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15)],
SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0),
LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15),
],
).center; ).center;
} }
@ -172,10 +154,7 @@ class Utils {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15)],
SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0),
LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15),
],
).center; ).center;
} }
@ -209,17 +188,7 @@ class Utils {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [6.height, alignCenter ? text.toText12().center : text.toText12(), 5.height, if (showDivider) const Divider(height: 1, color: Color(0xff2E303A), thickness: 1)],
6.height,
alignCenter ? text.toText12().center : text.toText12(),
5.height,
if (showDivider)
const Divider(
height: 1,
color: Color(0xff2E303A),
thickness: 1,
)
],
); );
} }
@ -227,17 +196,15 @@ class Utils {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: 1, // width: 1, //
color: background // <--- border width here color: background, // <--- border width here
), ),
borderRadius: BorderRadius.circular(radius), borderRadius: BorderRadius.circular(radius),
); );
} }
static Widget mHeight(double h) { static Widget mHeight(double h) {
return Container( return Container(height: h);
height: h,
);
} }
static Widget mDivider(Color color) { static Widget mDivider(Color color) {
@ -352,20 +319,21 @@ class Utils {
if (!Platform.isIOS) { if (!Platform.isIOS) {
await showCupertinoModalPopup( await showCupertinoModalPopup(
context: context, context: context,
builder: (BuildContext cxt) => Container( builder:
height: 250, (BuildContext cxt) => Container(
color: Colors.white, height: 250,
child: CupertinoDatePicker( color: Colors.white,
backgroundColor: Colors.white, child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date, backgroundColor: Colors.white,
onDateTimeChanged: (DateTime value) { mode: CupertinoDatePickerMode.date,
if (value != null && value != selectedDate) { onDateTimeChanged: (DateTime value) {
selectedDate = value; if (value != null && value != selectedDate) {
} selectedDate = value;
}, }
initialDateTime: selectedDate, },
), initialDateTime: selectedDate,
), ),
),
); );
} else { } else {
DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101)); DateTime? picked = await showDatePicker(context: context, initialDate: selectedDate, initialEntryMode: DatePickerEntryMode.calendarOnly, firstDate: DateTime(2015, 8), lastDate: DateTime(2101));
@ -377,19 +345,25 @@ 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
MifareUltralight f; .startSession(
if (Platform.isAndroid) { onDiscovered: (NfcTag tag) async {
f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22); MifareUltralight f;
} else { if (Platform.isAndroid) {
f = MifareUltralight(tag: tag, identifier: tag.data["mifare"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22); print(tag);
} f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22);
String identifier = f.identifier.map((e) => e.toRadixString(16).padLeft(2, '0')).join(''); } else {
NfcManager.instance.stopSession(); f = MifareUltralight(tag: tag, identifier: tag.data["mifare"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22);
onRead(identifier); }
}).catchError((err) { String identifier = f.identifier.map((e) => e.toRadixString(16).padLeft(2, '0')).join('');
print(err); NfcManager.instance.stopSession();
}); onRead(identifier);
},
pollingOptions: {NfcPollingOption.iso14443},
)
.catchError((err) {
print(err);
});
} }
//HUAWEI DECISION MAKING //HUAWEI DECISION MAKING

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:mohem_flutter_app/models/add_att_success_list_model.dart'; import 'package:mohem_flutter_app/models/add_att_success_list_model.dart';
import 'package:mohem_flutter_app/models/add_attachment_list_model.dart'; import 'package:mohem_flutter_app/models/add_attachment_list_model.dart';
import 'package:mohem_flutter_app/models/basic_member_information_model.dart'; import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
@ -391,275 +393,278 @@ class GenericResponseModel {
String? ePharmacyGetItemOnHandList; String? ePharmacyGetItemOnHandList;
bool? isActiveCode; bool? isActiveCode;
bool? isSMSSent; bool? isSMSSent;
PortalDirectionData? portalDirectionData;
GenericResponseModel(
{this.date, GenericResponseModel({
this.languageID, this.date,
this.serviceName, this.languageID,
this.time, this.portalDirectionData,
this.androidLink, this.serviceName,
this.authenticationTokenID, this.time,
this.data, this.androidLink,
this.dataw, this.authenticationTokenID,
this.dietType, this.data,
this.dietTypeID, this.dataw,
this.errorCode, this.dietType,
this.errorEndUserMessage, this.dietTypeID,
this.errorEndUserMessageN, this.errorCode,
this.errorMessage, this.errorEndUserMessage,
this.errorType, this.errorEndUserMessageN,
this.foodCategory, this.errorMessage,
this.iOSLink, this.errorType,
this.isAuthenticated, this.foodCategory,
this.mealOrderStatus, this.iOSLink,
this.mealType, this.isAuthenticated,
this.messageStatus, this.mealOrderStatus,
this.numberOfResultRecords, this.mealType,
this.patientBlodType, this.messageStatus,
this.successMsg, this.numberOfResultRecords,
this.successMsgN, this.patientBlodType,
this.vidaUpdatedResponse, this.successMsg,
this.addAttSuccessList, this.successMsgN,
this.addAttachmentList, this.vidaUpdatedResponse,
this.bCDomain, this.addAttSuccessList,
this.bCLogo, this.addAttachmentList,
this.basicMemberInformation, this.bCDomain,
this.businessCardPrivilege, this.bCLogo,
this.calculateAbsenceDuration, this.basicMemberInformation,
this.cancelHRTransactionLIst, this.businessCardPrivilege,
this.chatEmployeeLoginList, this.calculateAbsenceDuration,
this.companyBadge, this.cancelHRTransactionLIst,
this.companyImage, this.chatEmployeeLoginList,
this.companyImageDescription, this.companyBadge,
this.companyImageURL, this.companyImage,
this.companyMainCompany, this.companyImageDescription,
this.countryList, this.companyImageURL,
this.createVacationRuleList, this.companyMainCompany,
this.deleteAttachmentList, this.countryList,
this.deleteVacationRuleList, this.createVacationRuleList,
this.disableSessionList, this.deleteAttachmentList,
this.employeeQR, this.deleteVacationRuleList,
this.employeeDocumentsList, this.disableSessionList,
this.forgetPasswordTokenID, this.employeeQR,
this.getAbsenceAttachmentsList, this.employeeDocumentsList,
this.getAbsenceAttendanceTypesList, this.forgetPasswordTokenID,
this.getAbsenceCollectionNotificationBodyList, this.getAbsenceAttachmentsList,
this.getAbsenceDffStructureList, this.getAbsenceAttendanceTypesList,
this.getAbsenceTransactionList, this.getAbsenceCollectionNotificationBodyList,
this.getAccrualBalancesList, this.getAbsenceDffStructureList,
this.getActionHistoryList, this.getAbsenceTransactionList,
this.getPRActionHistoryList, this.getAccrualBalancesList,
this.getAddressDffStructureList, this.getActionHistoryList,
this.getAddressNotificationBodyList, this.getPRActionHistoryList,
this.getApprovesList, this.getAddressDffStructureList,
this.getAttachementList, this.getAddressNotificationBodyList,
this.getPRAttachmentList, this.getApprovesList,
this.getAttendanceTrackingList, this.getAttachementList,
this.getBasicDetColsStructureList, this.getPRAttachmentList,
this.getBasicDetDffStructureList, this.getAttendanceTrackingList,
this.getBasicDetNtfBodyList, this.getBasicDetColsStructureList,
this.getCEICollectionNotificationBodyList, this.getBasicDetDffStructureList,
this.getCEIDFFStructureList, this.getBasicDetNtfBodyList,
this.getCEITransactionList, this.getCEICollectionNotificationBodyList,
this.getCcpTransactionsList, this.getCEIDFFStructureList,
this.getCcpTransactionsListNew, this.getCEITransactionList,
this.getConcurrentProgramsList, this.getCcpTransactionsList,
this.getContactColsStructureList, this.getCcpTransactionsListNew,
this.getContactDetailsList, this.getConcurrentProgramsList,
this.getContactDffStructureList, this.getContactColsStructureList,
this.getContactNotificationBodyList, this.getContactDetailsList,
this.getCountriesList, this.getContactDffStructureList,
this.getDayHoursTypeDetailsList, this.getContactNotificationBodyList,
this.getDeductionsList, this.getCountriesList,
this.getDefaultValueList, this.getDayHoursTypeDetailsList,
this.getEITCollectionNotificationBodyList, this.getDeductionsList,
this.getEITDFFStructureList, this.getDefaultValueList,
this.getEITTransactionList, this.getEITCollectionNotificationBodyList,
this.getEarningsList, this.getEITDFFStructureList,
this.getEmployeeAddressList, this.getEITTransactionList,
this.getEmployeeBasicDetailsList, this.getEarningsList,
this.getEmployeeContactsList, this.getEmployeeAddressList,
this.getEmployeePhonesList, this.getEmployeeBasicDetailsList,
this.getEmployeeSubordinatesList, this.getEmployeeContactsList,
this.getFliexfieldStructureList, this.getEmployeePhonesList,
this.getHrCollectionNotificationBodyList, this.getEmployeeSubordinatesList,
this.getHrTransactionList, this.getFliexfieldStructureList,
this.getItemCreationNtfBodyList, this.getHrCollectionNotificationBodyList,
this.getItemTypeNotificationsList, this.getHrTransactionList,
this.getItemTypesList, this.getItemCreationNtfBodyList,
this.getLookupValuesList, this.getItemTypeNotificationsList,
this.getMenuEntriesList, this.getItemTypesList,
this.getEventActivityList, this.getLookupValuesList,
this.getMoItemHistoryList, this.getMenuEntriesList,
this.getMoNotificationBodyList, this.getEventActivityList,
this.getNotificationButtonsList, this.getMoItemHistoryList,
this.getNotificationReassignModeList, this.getMoNotificationBodyList,
this.getObjectValuesList, this.getNotificationButtonsList,
this.getOpenMissingSwipesList, this.getNotificationReassignModeList,
this.getOpenNotificationsList, this.getObjectValuesList,
this.getOpenNotificationsNumList, this.getOpenMissingSwipesList,
this.getOpenPeriodDatesList, this.getOpenNotificationsList,
this.getOrganizationsSalariesList, this.getOpenNotificationsNumList,
this.getPaymentInformationList, this.getOpenPeriodDatesList,
this.getPayslipList, this.getOrganizationsSalariesList,
this.getPerformanceAppraisalList, this.getPaymentInformationList,
this.getPhonesNotificationBodyList, this.getPayslipList,
this.getPoItemHistoryList, this.getPerformanceAppraisalList,
this.getPoNotificationBodyList, this.getPhonesNotificationBodyList,
this.getPrNotificationBodyList, this.getPoItemHistoryList,
this.getPaymentNotificationBodyList, this.getPoNotificationBodyList,
this.getPRInformationList, this.getPrNotificationBodyList,
this.getQuotationAnalysisList, this.getPaymentNotificationBodyList,
this.getRFCEmployeeListList, this.getPRInformationList,
this.getRespondAttributeValueList, this.getQuotationAnalysisList,
this.getSITCollectionNotificationBodyList, this.getRFCEmployeeListList,
this.getSITDFFStructureList, this.getRespondAttributeValueList,
this.getSITTransactionList, this.getSITCollectionNotificationBodyList,
this.getScheduleShiftsDetailsList, this.getSITDFFStructureList,
this.getShiftTypesList, this.getSITTransactionList,
this.getStampMsNotificationBodyList, this.getScheduleShiftsDetailsList,
this.getStampNsNotificationBodyList, this.getShiftTypesList,
this.getSubordinatesAttdStatusList, this.getStampMsNotificationBodyList,
this.getSubordinatesLeavesList, this.getStampNsNotificationBodyList,
this.getSubordinatesLeavesTotalVacationsList, this.getSubordinatesAttdStatusList,
this.getSummaryOfPaymentList, this.getSubordinatesLeavesList,
this.getSwipesList, this.getSubordinatesLeavesTotalVacationsList,
this.getTermColsStructureList, this.getSummaryOfPaymentList,
this.getTermDffStructureList, this.getSwipesList,
this.getTermNotificationBodyList, this.getTermColsStructureList,
this.getTimeCardSummaryList, this.getTermDffStructureList,
this.getTicketsByEmployeeList, this.getTermNotificationBodyList,
this.getTicketDetailsByEmployee, this.getTimeCardSummaryList,
this.getTicketTransactions, this.getTicketsByEmployeeList,
this.getTicketTypes, this.getTicketDetailsByEmployee,
this.getSectionTopics, this.getTicketTransactions,
this.getMowadhafhiProjects, this.getTicketTypes,
this.getProjectDepartments, this.getSectionTopics,
this.getDepartmentSections, this.getMowadhafhiProjects,
this.getPendingTransactionsFunctions, this.getProjectDepartments,
this.getPendingTransactionsDetails, this.getDepartmentSections,
this.getConcurrentProgramsModel, this.getPendingTransactionsFunctions,
this.getCCPTransactionsModel, this.getPendingTransactionsDetails,
this.getCCPOutputModel, this.getConcurrentProgramsModel,
this.getCCPDFFStructureModel, this.getCCPTransactionsModel,
this.getUserItemTypesList, this.getCCPOutputModel,
this.getVacationRulesList, this.getCCPDFFStructureModel,
this.getVaccinationOnHandList, this.getUserItemTypesList,
this.getVaccinationsList, this.getVacationRulesList,
this.getValueSetValuesList, this.getVaccinationOnHandList,
this.getWorkList, this.getVaccinationsList,
this.hRCertificateTemplate, this.getValueSetValuesList,
this.imgURLsList, this.getWorkList,
this.insertApInv, this.hRCertificateTemplate,
this.insertBooked, this.imgURLsList,
this.insertEmpSwipesList, this.insertApInv,
this.insertJournal, this.insertBooked,
this.insertOrders, this.insertEmpSwipesList,
this.intPortalGetEmployeeList, this.insertJournal,
this.isDeviceTokenEmpty, this.insertOrders,
this.isPasswordExpired, this.intPortalGetEmployeeList,
this.isRegisterAllowed, this.isDeviceTokenEmpty,
this.isRequriedValueSetEmpty, this.isPasswordExpired,
this.isUserSMSExcluded, this.isRegisterAllowed,
this.itemOnHand, this.isRequriedValueSetEmpty,
this.languageAvailable, this.isUserSMSExcluded,
this.listSupplier, this.itemOnHand,
this.listUserAgreement, this.languageAvailable,
this.listEITStrucrure, this.listSupplier,
this.listItemImagesDetails, this.listUserAgreement,
this.listItemMaster, this.listEITStrucrure,
this.listMedicineDetails, this.listItemImagesDetails,
this.listMenu, this.listItemMaster,
this.listNewEmployees, this.listMedicineDetails,
this.listRadScreen, this.listMenu,
this.logInTokenID, this.listNewEmployees,
this.memberInformationList, this.listRadScreen,
this.memberLoginList, this.logInTokenID,
this.mohemmGetBusinessCardEnabledList, this.memberInformationList,
this.mohemmGetFavoriteReplacementsList, this.memberLoginList,
this.mohemmGetMobileDeviceInfobyEmpInfoList, this.mohemmGetBusinessCardEnabledList,
this.mohemmGetMobileLoginInfoList, this.mohemmGetFavoriteReplacementsList,
this.mohemmGetPatientIDList, this.mohemmGetMobileDeviceInfobyEmpInfoList,
this.mohemmITGResponseItem, this.mohemmGetMobileLoginInfoList,
this.mohemmIsChangeIsActiveBusinessCardEnable, this.mohemmGetPatientIDList,
this.mohemmIsInsertBusinessCardEnable, this.mohemmITGResponseItem,
this.mohemmWifiPassword, this.mohemmIsChangeIsActiveBusinessCardEnable,
this.mohemmWifiSSID, this.mohemmIsInsertBusinessCardEnable,
this.notificationAction, this.mohemmWifiPassword,
this.notificationGetRespondAttributesList, this.mohemmWifiSSID,
this.notificationRespondRolesList, this.notificationAction,
this.oracleOutPutNumber, this.notificationGetRespondAttributesList,
this.pASSWORDEXPIREDMSG, this.notificationRespondRolesList,
this.pCOUNTRYCODE, this.oracleOutPutNumber,
this.pCOUNTRYNAME, this.pASSWORDEXPIREDMSG,
this.pDESCFLEXCONTEXTCODE, this.pCOUNTRYCODE,
this.pDESCFLEXCONTEXTNAME, this.pCOUNTRYNAME,
this.pForm, this.pDESCFLEXCONTEXTCODE,
this.pINFORMATION, this.pDESCFLEXCONTEXTNAME,
this.pMBLID, this.pForm,
this.pNUMOFSUBORDINATES, this.pINFORMATION,
this.pOPENNTFNUMBER, this.pMBLID,
this.pQUESTION, this.pNUMOFSUBORDINATES,
this.pSESSIONID, this.pOPENNTFNUMBER,
this.pSchema, this.pQUESTION,
this.pharmacyStockAddPharmacyStockList, this.pSESSIONID,
this.pharmacyStockGetOnHandList, this.pSchema,
this.privilegeList, this.pharmacyStockAddPharmacyStockList,
this.processTransactions, this.pharmacyStockGetOnHandList,
this.registerUserNameList, this.privilegeList,
this.replacementList, this.processTransactions,
this.respondAttributesList, this.registerUserNameList,
this.respondRolesList, this.replacementList,
this.resubmitAbsenceTransactionList, this.respondAttributesList,
this.resubmitEITTransactionList, this.respondRolesList,
this.resubmitHrTransactionList, this.resubmitAbsenceTransactionList,
this.sFHGetPoNotificationBodyList, this.resubmitEITTransactionList,
this.sFHGetPrNotificationBodyList, this.resubmitHrTransactionList,
this.startAbsenceApprovalProccess, this.sFHGetPoNotificationBodyList,
this.startAddressApprovalProcessList, this.sFHGetPrNotificationBodyList,
this.startBasicDetApprProcessList, this.startAbsenceApprovalProccess,
this.startCeiApprovalProcess, this.startAddressApprovalProcessList,
this.startContactApprovalProcessList, this.startBasicDetApprProcessList,
this.startEitApprovalProcess, this.startCeiApprovalProcess,
this.startHrApprovalProcessList, this.startContactApprovalProcessList,
this.startPhonesApprovalProcessList, this.startEitApprovalProcess,
this.startSitApprovalProcess, this.startHrApprovalProcessList,
this.startTermApprovalProcessList, this.startPhonesApprovalProcessList,
this.submitAddressTransactionList, this.startSitApprovalProcess,
this.submitBasicDetTransactionList, this.startTermApprovalProcessList,
this.submitCEITransactionList, this.submitAddressTransactionList,
this.submitCcpTransactionList, this.submitBasicDetTransactionList,
this.submitContactTransactionList, this.submitCEITransactionList,
this.submitEITTransactionList, this.submitCcpTransactionList,
this.submitHrTransactionList, this.submitContactTransactionList,
this.submitPhonesTransactionList, this.submitEITTransactionList,
this.submitSITTransactionList, this.submitHrTransactionList,
this.submitTermTransactionList, this.submitPhonesTransactionList,
this.subordinatesOnLeavesList, this.submitSITTransactionList,
this.sumbitAbsenceTransactionList, this.submitTermTransactionList,
this.tokenID, this.subordinatesOnLeavesList,
this.updateAttachmentList, this.sumbitAbsenceTransactionList,
this.updateEmployeeImageList, this.tokenID,
this.updateItemTypeSuccessList, this.updateAttachmentList,
this.updateUserItemTypesList, this.updateEmployeeImageList,
this.updateVacationRuleList, this.updateItemTypeSuccessList,
this.vHREmployeeLoginList, this.updateUserItemTypesList,
this.vHRGetEmployeeDetailsList, this.updateVacationRuleList,
this.vHRGetManagersDetailsList, this.vHREmployeeLoginList,
this.vHRGetProjectByCodeList, this.vHRGetEmployeeDetailsList,
this.vHRIsVerificationCodeValid, this.vHRGetManagersDetailsList,
this.validateAbsenceTransactionList, this.vHRGetProjectByCodeList,
this.validateEITTransactionList, this.vHRIsVerificationCodeValid,
this.validatePhonesTransactionList, this.validateAbsenceTransactionList,
this.vrItemTypesList, this.validateEITTransactionList,
this.wFLookUpList, this.validatePhonesTransactionList,
this.eLearningGETEMPLOYEEPROFILEList, this.vrItemTypesList,
this.eLearningLOGINList, this.wFLookUpList,
this.eLearningValidateLoginList, this.eLearningGETEMPLOYEEPROFILEList,
this.eLearningValidate_LoginList, this.eLearningLOGINList,
this.ePharmacyGetItemOnHandList, this.eLearningValidateLoginList,
this.isActiveCode, this.eLearningValidate_LoginList,
this.isSMSSent}); this.ePharmacyGetItemOnHandList,
this.isActiveCode,
this.isSMSSent,
});
GenericResponseModel.fromJson(Map<String, dynamic> json) { GenericResponseModel.fromJson(Map<String, dynamic> json) {
date = json['Date']; date = json['Date'];
@ -688,6 +693,7 @@ class GenericResponseModel {
successMsg = json['SuccessMsg']; successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN']; successMsgN = json['SuccessMsgN'];
vidaUpdatedResponse = json['VidaUpdatedResponse']; vidaUpdatedResponse = json['VidaUpdatedResponse'];
portalDirectionData = json["PortalDirectionData"] == null ? null : PortalDirectionData.fromJson(json["PortalDirectionData"]);
if (json['AddAttSuccessList'] != null) { if (json['AddAttSuccessList'] != null) {
addAttSuccessList = <AddAttSuccessList>[]; addAttSuccessList = <AddAttSuccessList>[];
@ -848,9 +854,10 @@ class GenericResponseModel {
}); });
} }
getCEICollectionNotificationBodyList = json["GetCEICollectionNotificationBodyList"] == null getCEICollectionNotificationBodyList =
? null json["GetCEICollectionNotificationBodyList"] == null
: List<GetEitCollectionNotificationBodyList>.from(json["GetCEICollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x))); ? null
: List<GetEitCollectionNotificationBodyList>.from(json["GetCEICollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x)));
if (json['GetCEIDFFStructureList'] != null) { if (json['GetCEIDFFStructureList'] != null) {
getCEIDFFStructureList = <GetEITDFFStructureList>[]; getCEIDFFStructureList = <GetEITDFFStructureList>[];
@ -909,9 +916,10 @@ class GenericResponseModel {
}); });
} }
getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null; getDefaultValueList = json['GetDefaultValueList'] != null ? GetDefaultValueList.fromJson(json['GetDefaultValueList']) : null;
getEITCollectionNotificationBodyList = json["GetEITCollectionNotificationBodyList"] == null getEITCollectionNotificationBodyList =
? null json["GetEITCollectionNotificationBodyList"] == null
: List<GetEitCollectionNotificationBodyList>.from(json["GetEITCollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x))); ? null
: List<GetEitCollectionNotificationBodyList>.from(json["GetEITCollectionNotificationBodyList"].map((x) => GetEitCollectionNotificationBodyList.fromJson(x)));
if (json['GetEITDFFStructureList'] != null) { if (json['GetEITDFFStructureList'] != null) {
getEITDFFStructureList = <GetEITDFFStructureList>[]; getEITDFFStructureList = <GetEITDFFStructureList>[];
json['GetEITDFFStructureList'].forEach((v) { json['GetEITDFFStructureList'].forEach((v) {
@ -1475,6 +1483,7 @@ class GenericResponseModel {
data['SuccessMsg'] = this.successMsg; data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN; data['SuccessMsgN'] = this.successMsgN;
data['VidaUpdatedResponse'] = this.vidaUpdatedResponse; data['VidaUpdatedResponse'] = this.vidaUpdatedResponse;
data['PortalDirectionData'] = portalDirectionData?.toJson();
if (this.addAttSuccessList != null) { if (this.addAttSuccessList != null) {
data['AddAttSuccessList'] = this.addAttSuccessList!.map((v) => v.toJson()).toList(); data['AddAttSuccessList'] = this.addAttSuccessList!.map((v) => v.toJson()).toList();
@ -1930,3 +1939,25 @@ class GenericResponseModel {
return data; return data;
} }
} }
class PortalDirectionData {
String? pRedirection;
String? clientID;
PortalDirectionData({this.pRedirection, this.clientID});
factory PortalDirectionData.fromRawJson(String str) => PortalDirectionData.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory PortalDirectionData.fromJson(Map<String, dynamic> json) => PortalDirectionData(pRedirection: json["P_REDIRECTION"], clientID: json["ClientID"]);
Map<String, dynamic> toJson() => {"P_REDIRECTION": pRedirection, "ClientID": clientID};
}
class TicketBookingResult {
final bool success;
final String? clientId;
TicketBookingResult(this.success, this.clientId);
}

@ -0,0 +1,65 @@
import 'dart:convert';
class SSOAuthModel {
String? status;
List<dynamic>? message;
Data? data;
SSOAuthModel({
this.status,
this.message,
this.data,
});
factory SSOAuthModel.fromRawJson(String str) => SSOAuthModel.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory SSOAuthModel.fromJson(Map<String, dynamic> json) => SSOAuthModel(
status: json["status"],
message: json["message"] == null ? [] : List<dynamic>.from(json["message"]!.map((x) => x)),
data: json["data"] == null ? null : Data.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"status": status,
"message": message == null ? [] : List<dynamic>.from(message!.map((x) => x)),
"data": data?.toJson(),
};
}
class Data {
String? accessToken;
String? idToken;
int? expiresIn;
String? refreshToken;
String? postBackUrl;
Data({
this.accessToken,
this.idToken,
this.expiresIn,
this.refreshToken,
this.postBackUrl,
});
factory Data.fromRawJson(String str) => Data.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory Data.fromJson(Map<String, dynamic> json) => Data(
accessToken: json["accessToken"],
idToken: json["idToken"],
expiresIn: json["expiresIn"],
refreshToken: json["refreshToken"],
postBackUrl: json["postBackUrl"],
);
Map<String, dynamic> toJson() => {
"accessToken": accessToken,
"idToken": idToken,
"expiresIn": expiresIn,
"refreshToken": refreshToken,
"postBackUrl": postBackUrl,
};
}

@ -21,6 +21,7 @@ import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_respo
import 'package:mohem_flutter_app/models/generic_response_model.dart'; import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart'; import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/models/sso_auth_model.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool /// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
@ -239,6 +240,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
homeMenus = parseMenus(getMenuEntriesList ?? []); homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) { if (homeMenus!.isNotEmpty) {
homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr())); homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr()));
// homeMenus!.first.menuEntiesList.insert(1, GetMenuEntriesList(requestType: "TICKET_BOOKING", prompt: "Ticket Booking"));
homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr())); homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr()));
} }
isServicesMenusLoading = false; isServicesMenusLoading = false;
@ -283,6 +285,61 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
} }
Future<TicketBookingResult> fetchTicketBooking() async {
try {
GenericResponseModel? genericResponseModel = await DashboardApiClient().getTicketBookingRedirection();
if (genericResponseModel?.portalDirectionData?.pRedirection!.toLowerCase() == "alma") {
return TicketBookingResult(true, genericResponseModel?.portalDirectionData?.clientID);
}
return TicketBookingResult(false, null);
} catch (ex) {
logger.wtf(ex);
isEventLoadingLoading = false;
notifyListeners();
Utils.handleException(ex, null, null);
return TicketBookingResult(false, null); // Ensure a return value in case of an exception
}
}
Future<SSOAuthModel?> fetchSSOAuthRedirection({String? clientID}) async {
try {
SSOAuthModel? ssoResponse = await DashboardApiClient().getBookingSSOAuthRedirection(clientID: clientID!);
logger.d("SSO Response: ${ssoResponse!.toJson()}");
if (ssoResponse.status == "Success") {
return ssoResponse;
} else {
Utils.showToast(ssoResponse.message!.first ?? "Failed to fetch SSO Auth Token");
return null;
}
} catch (ex) {
logger.wtf(ex);
isEventLoadingLoading = false;
notifyListeners();
Utils.handleException(ex, null, null);
return null; // Ensure a return value in case of an exception
}
}
Future<dynamic> fetchURLRedirection({required String token}) async {
try {
dynamic res = await DashboardApiClient().getBookingSSOFinalRedirection(token: token);
logger.d("SSO URL: $res");
return res;
// if (ssoResponse.status == "Success") {
// return ssoResponse;
// } else {
// Utils.showToast(ssoResponse.message!.first ?? "Failed to fetch SSO Auth Token");
// return null;
// }
} catch (ex) {
logger.wtf(ex);
isEventLoadingLoading = false;
notifyListeners();
Utils.handleException(ex, null, null);
return null; // Ensure a return value in case of an exception
}
}
List<Menus> parseMenus(List<GetMenuEntriesList> getMenuEntriesList) { List<Menus> parseMenus(List<GetMenuEntriesList> getMenuEntriesList) {
List<Menus> menus = []; List<Menus> menus = [];
for (int i = 0; i < getMenuEntriesList.length; i++) { for (int i = 0; i < getMenuEntriesList.length; i++) {
@ -316,8 +373,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return res; return res;
} }
void notify() { void notify() {
notifyListeners(); notifyListeners();
} }

@ -1,20 +1,55 @@
import 'dart:convert';
import 'dart:developer';
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/inAppWebView.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_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/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/sso_auth_model.dart';
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart'; import 'package:mohem_flutter_app/ui/my_attendance/services_menu_list_screen.dart';
import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart'; import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class ServicesWidget extends StatelessWidget { class ServicesWidget extends StatelessWidget {
MyInAppBrowser? myInAppBrowser;
var inAppBrowserOptions = InAppBrowserClassSettings(
webViewSettings: InAppWebViewSettings(
useShouldOverrideUrlLoading: false,
transparentBackground: false,
isInspectable: false,
applePayAPIEnabled: true,
cacheEnabled: false,
allowsBackForwardNavigationGestures: false,
),
browserSettings: InAppBrowserSettings(
hideUrlBar: true,
hideTitleBar: true,
hideDefaultMenuItems: true,
hideToolbarBottom: true,
hideToolbarTop: false,
hideCloseButton: false,
allowGoBackWithBackButton: false,
toolbarBottomBackgroundColor: Colors.black,
closeButtonColor: Colors.white,
presentationStyle: ModalPresentationStyle.FULL_SCREEN,
// toolbarTopBackgroundColor: Colors.black
),
);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<String> namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()]; List<String> namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()];
@ -26,7 +61,7 @@ class ServicesWidget extends StatelessWidget {
"assets/images/vacation_rule.svg", "assets/images/vacation_rule.svg",
"assets/images/ticket_request.svg", "assets/images/ticket_request.svg",
"assets/images/ticket_request.svg", "assets/images/ticket_request.svg",
"assets/images/ticket_request.svg" "assets/images/ticket_request.svg",
]; ];
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(
@ -34,72 +69,69 @@ class ServicesWidget extends StatelessWidget {
return data.isServicesMenusLoading return data.isServicesMenusLoading
? whileLoading() ? whileLoading()
: ListView.separated( : ListView.separated(
padding: const EdgeInsets.only(top: 0), padding: const EdgeInsets.only(top: 0),
itemBuilder: (context, parentIndex) { itemBuilder: (context, parentIndex) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21), data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox( SizedBox(
height: 105 + 26, height: 105 + 26,
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) { itemBuilder: (cxt, index) {
return AspectRatio( return AspectRatio(
aspectRatio: 105 / 105, aspectRatio: 105 / 105,
child: data.isServicesMenusLoading child:
data.isServicesMenusLoading
? ServicesMenuShimmer() ? ServicesMenuShimmer()
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
boxShadow: [ boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))],
BoxShadow( ),
color: const Color(0xff000000).withOpacity(.05), child: Column(
blurRadius: 26, mainAxisAlignment: MainAxisAlignment.spaceBetween,
offset: const Offset(0, -3), crossAxisAlignment: CrossAxisAlignment.start,
), children: [
], SvgPicture.asset(
), AppState().isArabic(context)
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(AppState().isArabic(context)
? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)
: getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)), : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!),
Row( ),
crossAxisAlignment: CrossAxisAlignment.end, Row(
children: [ crossAxisAlignment: CrossAxisAlignment.end,
Expanded( children: [
child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true), Expanded(child: data.homeMenus![parentIndex].menuEntiesList[index].prompt!.toText11(isBold: true)),
), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)), ],
], ),
) ],
], ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12),
).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), ).onPress(() {
).onPress(() { handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]); }),
}), );
); },
}, separatorBuilder: (cxt, index) => 9.width,
separatorBuilder: (cxt, index) => 9.width, itemCount: data.homeMenus![parentIndex].menuEntiesList.length,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length),
), ),
], ),
); ],
}, );
separatorBuilder: (context, index) { },
return 12.height; separatorBuilder: (context, index) {
}, return 12.height;
shrinkWrap: true, },
physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,
itemCount: data.homeMenus!.length); physics: const NeverScrollableScrollPhysics(),
itemCount: data.homeMenus!.length,
);
}, },
); );
} }
@ -196,7 +228,7 @@ class ServicesWidget extends StatelessWidget {
return returnImage; return returnImage;
} }
void handleOnPress(context, GetMenuEntriesList menuEntry) { Future<void> handleOnPress(context, GetMenuEntriesList menuEntry) async {
var pro = Provider.of<DashboardProviderModel>(context, listen: false); var pro = Provider.of<DashboardProviderModel>(context, listen: false);
if (menuEntry.requestType == "MONTHLY_ATTENDANCE") { if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance); Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
@ -220,9 +252,87 @@ class ServicesWidget extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.monthlyPaySlip); Navigator.pushNamed(context, AppRoutes.monthlyPaySlip);
} }
} else { } else {
List<GetMenuEntriesList> _menuList = if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? []; Utils.showLoading(context);
Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList.isEmpty ? menuList : _menuList)); print("=========");
TicketBookingResult response = await pro.fetchTicketBooking();
Utils.hideLoading(context);
if (response.success) {
print("============ Allowed ============");
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId);
if (ssoToken != null) {
logger.d(ssoToken.data!.toJson());
logger.d(ssoToken.data!.accessToken);
dynamic valu = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
myInAppBrowser = MyInAppBrowser(
onExitCallback: () {
log("Browser Exited");
},
onLoadStartCallback: (String url) {
log("Browser LoadStart for : $url");
if (url.contains("https://ek.techmaster.in/")) {
// Handle the URL as needed
log("SSO URL Loaded: $url");
}
},
);
await myInAppBrowser!.openUrlRequest(
urlRequest: URLRequest(
url: WebUri(valu, forceToStringRawValue: true),
allowsCellularAccess: true,
allowsConstrainedNetworkAccess: true,
allowsExpensiveNetworkAccess: true,
// headers: {'Authorization': 'Bearer ${ssoToken.data!.accessToken}'},
),
settings: inAppBrowserOptions,
);
// Navigator.of(context).push(
// MaterialPageRoute(
// builder:
// (context) => WebViewWidget(
// controller:
// WebViewController()
// ..setJavaScriptMode(JavaScriptMode.unrestricted)
// ..setNavigationDelegate(
// NavigationDelegate(
// onNavigationRequest: (NavigationRequest request) {
// return NavigationDecision.navigate;
// },
// onHttpError: (HttpResponseError response) {
// print(response.response!.statusCode);
// },
// onProgress: (int value) {
// print(value);
// },
// onWebResourceError: (WebResourceError error) {
// print(error.errorCode);
// print(error.description);
// },
// ),
// )
// ..loadRequest(Uri.parse("https://ek.techmaster.in/SSO/HMG"), headers: {'Authorization': 'Bearer ${ssoToken.data!.accessToken}'}),
// ),
// ),
// );
// launchUrl(Uri.parse("https://ek.techmaster.in/SSO/HMG"),headers: {'Authorization': 'Bearer ${ssoToken.data!.accessToken}'}, mode: LaunchMode.inAppBrowserView);
// ddv
print("============ Token Fetched ============");
}
} else {
List<GetMenuEntriesList> _menuList =
pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? [];
Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList.isEmpty ? menuList : _menuList));
}
} else {
List<GetMenuEntriesList> _menuList =
pro.getMenuEntriesList?.where((element) => element.parentMenuName == menuEntry.menuName && (element.menuEntryType == "FUNCTION" || element.menuEntryType == "MENU")).toList() ?? [];
Navigator.pushNamed(context, AppRoutes.servicesMenuListScreen, arguments: ServicesMenuListScreenParams(menuEntry.prompt!, _menuList.isEmpty ? menuList : _menuList));
}
} }
return; return;
} }
@ -253,10 +363,7 @@ class ServicesWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) { itemBuilder: (cxt, index) {
return AspectRatio( return AspectRatio(aspectRatio: 105 / 105, child: ServicesMenuShimmer());
aspectRatio: 105 / 105,
child: ServicesMenuShimmer(),
);
}, },
separatorBuilder: (cxt, index) => 9.width, separatorBuilder: (cxt, index) => 9.width,
itemCount: 4, itemCount: 4,

@ -16,7 +16,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart'; import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:share/share.dart'; import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class OffersAndDiscountsDetails extends StatefulWidget { class OffersAndDiscountsDetails extends StatefulWidget {
@ -127,7 +127,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
Directory tempDir = await getTemporaryDirectory(); Directory tempDir = await getTemporaryDirectory();
File file = await File('${tempDir.path}/${DateTime.now().toString()}.png').create(); File file = await File('${tempDir.path}/${DateTime.now().toString()}.png').create();
await file.writeAsBytes(pngBytes); await file.writeAsBytes(pngBytes);
await Share.shareFiles([(file.path)], text: AppState().isArabic(context) ? getOffersList[0].titleAr : getOffersList[0].titleEn); await SharePlus.instance.share(ShareParams(files: [(XFile(file.path))], text: AppState().isArabic(context) ? getOffersList[0].titleAr : getOffersList[0].titleEn));
} catch (ex) { } catch (ex) {
debugPrint(ex.toString()); debugPrint(ex.toString());
} }
@ -155,7 +155,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Hero( Hero(
tag: "ItemImage" + getOffersList.offersDiscountId.toString()!, tag: "ItemImage" + getOffersList.offersDiscountId.toString(),
transitionOnUserGestures: true, transitionOnUserGestures: true,
child: AspectRatio( child: AspectRatio(
aspectRatio: 148 / 127, aspectRatio: 148 / 127,

@ -24,7 +24,6 @@ import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart';
import 'package:mohem_flutter_app/widgets/qr_scanner_dialog.dart'; import 'package:mohem_flutter_app/widgets/qr_scanner_dialog.dart';
import 'package:nfc_manager/nfc_manager.dart'; import 'package:nfc_manager/nfc_manager.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:platform_device_id/platform_device_id.dart';
import 'package:wifi_iot/wifi_iot.dart'; import 'package:wifi_iot/wifi_iot.dart';
class MarkAttendanceWidget extends StatefulWidget { class MarkAttendanceWidget extends StatefulWidget {

@ -41,7 +41,7 @@ dependencies:
provider: ^6.0.1 provider: ^6.0.1
easy_localization: ^3.0.0 easy_localization: ^3.0.0
http: ^1.3.0 http: ^1.3.0
permission_handler: ^10.2.0 permission_handler: ^12.0.1
flutter_svg: any flutter_svg: any
sizer: ^2.0.15 sizer: ^2.0.15
local_auth: ^2.3.0 local_auth: ^2.3.0
@ -50,19 +50,16 @@ dependencies:
# flutter_calendar_carousel: ^2.1.0 # flutter_calendar_carousel: ^2.1.0
pie_chart: ^5.1.0 pie_chart: ^5.1.0
shared_preferences: ^2.0.12 shared_preferences: ^2.0.12
firebase_messaging: ^13.0.4 firebase_messaging: ^15.2.9
shimmer: ^2.0.0 shimmer: ^2.0.0
logger: ^1.1.0 logger: ^1.1.0
flutter_countdown_timer: ^4.1.0 flutter_countdown_timer: ^4.1.0
nfc_manager: ^3.2.0
# uuid: ^3.0.6 platform_device_id_plus: ^1.0.7
# device_info_plus: ^4.0.0
# android_id: ^0.1.3+1
platform_device_id: ^1.0.1
image_picker: ^0.8.5+3 image_picker: ^0.8.5+3
file_picker: ^8.3.1 file_picker: ^8.3.1
geolocator: ^9.0.2 geolocator: ^9.0.2
month_year_picker: ^0.4.0+1 month_year_picker: ^0.5.0+1
month_picker_dialog: ^6.0.3 month_picker_dialog: ^6.0.3
# open_file: ^3.2.1 # open_file: ^3.2.1
open_filex: ^4.6.0 open_filex: ^4.6.0
@ -72,7 +69,7 @@ dependencies:
qr_code_scanner: ^1.0.1 qr_code_scanner: ^1.0.1
# qr_flutter: ^4.0.0 # qr_flutter: ^4.0.0
url_launcher: ^6.0.15 url_launcher: ^6.0.15
share: 2.0.4 share_plus: ^11.0.0
flutter_rating_bar: ^4.0.1 flutter_rating_bar: ^4.0.1
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
pull_to_refresh: ^2.0.0 pull_to_refresh: ^2.0.0
@ -112,17 +109,27 @@ dependencies:
# huawei_hmsavailability: ^6.6.0+300 # huawei_hmsavailability: ^6.6.0+300
# huawei_location: 6.0.0+302 # huawei_location: 6.0.0+302
huawei_location: ^6.11.0+301 huawei_location: ^6.11.0+301
huawei_push: ^6.7.0+300 # huawei_push: ^6.7.0+300
firebase_crashlytics: ^2.9.0
huawei_map:
git:
url: https://github.com/fleoparra/hms-flutter-plugin.git
path: flutter-hms-map
huawei_push:
git:
url: https://github.com/crasowas/hms-flutter-plugin.git
path: flutter-hms-push
firebase_crashlytics: ^4.3.9
#Items for sale Image Carousel Slider #Items for sale Image Carousel Slider
carousel_slider: ^5.0.0 carousel_slider: ^5.0.0
#Huawei Specified #Huawei Specified
# store_checker: ^1.1.0 # store_checker: ^1.1.0
google_api_availability: ^3.0.1 google_api_availability: ^5.0.1
in_app_update: 4.1.0 in_app_update: 4.1.0
flutter_inappwebview: ^6.1.5
#todo its for temporary purpose, later will remove this. #todo its for temporary purpose, later will remove this.
dotted_border: ^2.0.0+3 dotted_border: ^2.0.0+3
@ -131,7 +138,8 @@ dependencies:
dependency_overrides: dependency_overrides:
firebase_core_platform_interface: 4.5.1 nfc_manager: ^3.2.0
# firebase_core_platform_interface: 4.5.1
dev_dependencies: dev_dependencies:

Loading…
Cancel
Save