Compare commits

...

19 Commits

Author SHA1 Message Date
haroon amjad 55ece8921f Merge branch 'mohem_flutter_upgrade'
# Conflicts:
#	lib/app_state/app_state.dart
#	lib/classes/consts.dart
3 months ago
haroon amjad 7384f22942 Update to stores, VersionID 9.2 3 months ago
Aamir Muhammad 0e54c7dac9 worklist actions fragment action button changes 3 months ago
Aamir Muhammad d651b34381 Merge branch 'flutter_upgrade_with_timesheet_changes' into mohem_flutter_upgrade
# Conflicts:
#	android/app/build.gradle
#	android/build.gradle
#	android/gradle.properties
#	android/gradle/wrapper/gradle-wrapper.properties
#	android/settings.gradle
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/api/dashboard_api_client.dart
#	lib/classes/consts.dart
#	lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart
#	lib/widgets/mark_attendance_widget.dart
#	pubspec.yaml
3 months ago
Aamir Muhammad c62f3f6485 Merge branch 'master' into mohem_flutter_upgrade
# Conflicts:
#	lib/generated/codegen_loader.g.dart
#	lib/generated/locale_keys.g.dart
3 months ago
Aamir Muhammad 5864c77226 worklist actions fragment action button changes 3 months ago
Aamir Muhammad 8d6c3ddc0b mazaya banner changes 3 months ago
Aamir Muhammad 515ffef14e tickt booking implementation 3 months ago
Aamir Muhammad f61817937b tickt booking implementation 3 months ago
Syed Taha Alam e50d1f70b2 upgraded the sdk to 35 3 months ago
Aamir Muhammad cd36d61640 logins apis 4 months ago
Sultan khan b2ffa0c619 Merge branch 'master' into mohem_flutter_upgrade
# Conflicts:
#	assets/langs/ar-SA.json
#	assets/langs/en-US.json
#	lib/app_state/app_state.dart
#	lib/classes/consts.dart
#	lib/dialogs/otp_dialog.dart
#	lib/generated/codegen_loader.g.dart
#	lib/generated/locale_keys.g.dart
#	lib/theme/app_theme.dart
#	lib/ui/attendance/monthly_attendance_screen.dart
#	lib/ui/chat/chat_home_screen.dart
#	lib/ui/login/verify_last_login_screen.dart
#	lib/ui/login/verify_login_screen.dart
#	lib/ui/my_team/view_attendance.dart
#	lib/ui/profile/delete_family_member.dart
#	lib/ui/screens/offers_and_discounts/offers_and_discounts_details.dart
#	lib/ui/work_list/worklist_detail_screen.dart
#	lib/ui/work_list/worklist_fragments/info_fragments.dart
#	lib/widgets/app_bar_widget.dart
#	lib/widgets/image_picker.dart
#	lib/widgets/nfc/nfc_reader_sheet.dart
#	pubspec.yaml
4 months ago
Sultan khan 3b3046804e upgraded 5 months ago
Sultan khan ea7467502f updated changes for payment worklist. 1 year ago
taha.alam c72189bb6b version number changed 1 year ago
taha.alam adc26a2435 Merge branch 'payment_worklist_CR_6939' of http://34.17.75.184/Haroon6138/mohemm-flutter-app into mohem_flutter_upgrade
# Conflicts:
#	lib/app_state/app_state.dart
#	lib/classes/consts.dart
#	lib/generated/codegen_loader.g.dart
#	lib/generated/locale_keys.g.dart
#	lib/ui/work_list/worklist_detail_screen.dart
1 year ago
taha.alam 9cbbbebe4b Merge branch 'master' of http://34.17.75.184/Haroon6138/mohemm-flutter-app into mohem_flutter_upgrade
# Conflicts:
#	pubspec.yaml
1 year ago
taha.alam 2e3abed42e WD: dialog color changes. 1 year ago
taha.alam 2bdaaf9e16 WD: flutter upgrade fron 3.7 to 3.19.0 1 year ago

@ -1,5 +1,6 @@
{
"cSpell.words": [
"MPLOYEEIMAGE"
]
],
"java.configuration.updateBuildConfiguration": "disabled"
}

@ -0,0 +1,57 @@
{
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"2640966000002322881",
"product_id":"737518067793559971",
"client_id":"715996003571874624",
"client_secret":"B5B89A56A53847C6BB9D216A8747E75952760DF9A8232239D8744CD847A8FFDA",
"project_id":"737518067793559971",
"app_id":"104737117",
"api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==",
"package_name":"hmg.cloudSolutions.mohem"
},
"oauth_client":{
"client_id":"104737117",
"client_type":1
},
"app_info":{
"app_id":"104737117",
"package_name":"hmg.cloudSolutions.mohem"
},
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"hmg.cloudSolutions.mohem",
"client":{
"app_id":"104737117"
},
"app_info":{
"package_name":"hmg.cloudSolutions.mohem",
"app_id":"104737117"
},
"oauth_client":{
"client_type":1,
"client_id":"104737117"
}
}
]
}

@ -1,25 +1,12 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
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.")
plugins {
id "com.android.application"
id "kotlin-android"
id "com.google.gms.google-services"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.firebase.crashlytics"
id "com.huawei.agconnect"
}
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 keystorePropertiesFile = rootProject.file('key.properties')
@ -27,18 +14,17 @@ if (keystorePropertiesFile.exists()) {
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
namespace 'hmg.cloudSolutions.mohem'
compileSdk 36 // Changed from 36 to a supported version
ndkVersion '28.2.13676358'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}
kotlinOptions {
@ -53,9 +39,15 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "hmg.cloudSolutions.mohem"
minSdkVersion 28
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// targetSdk = flutter.targetSdkVersion
targetSdk 35
versionCode flutter.versionCode
versionName flutter.versionName
multiDexEnabled true
}
buildFeatures{
buildConfig true
}
signingConfigs {
@ -84,5 +76,9 @@ flutter {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation 'com.huawei.hms:push:6.11.0.300'
}

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mohem_flutter_app">
>
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mohem_flutter_app">
>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />

@ -1,4 +1,4 @@
package com.mohem_flutter_app
package hmg.cloudSolutions.mohem
//import io.flutter.embedding.android.FlutterActivity
//

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mohem_flutter_app">
>
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

@ -1,5 +1,4 @@
buildscript {
ext.kotlin_version = '1.9.10'
repositories {
google()
mavenCentral()
@ -7,11 +6,10 @@ buildscript {
}
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"
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.huawei.agconnect:agcp:1.9.1.304'
}
}
@ -21,14 +19,66 @@ allprojects {
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
// Exclude old BouncyCastle globally to avoid duplicate classes
configurations.all {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk16'
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
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'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
delete rootProject.layout.buildDirectory
}

@ -1,4 +1,6 @@
org.gradle.jvmargs=-Xmx2048M
android.useAndroidX=true
android.enableJetifier=true
org.gradle.java.home=/Users/user/Library/Java/JavaVirtualMachines/jbr-17.0.12/Contents/Home/
apmsInstrumentationEnabled=false
#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
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
zipStorePath=wrapper/dists

@ -1,11 +1,56 @@
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()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://developer.huawei.com/repo/' }
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.huawei.agconnect") {
useModule("com.huawei.agconnect:agcp:1.9.1.304")
}
}
}
}
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
id "com.huawei.agconnect" version "1.9.1.304" apply false
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://developer.huawei.com/repo/' }
maven {
url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local"
}
}
}
include ":app"

@ -619,5 +619,6 @@
"explore": "يستكشف",
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين"
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya" : "أعرض كل المزايا"
}

@ -617,6 +617,7 @@
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees"
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya" : "View All Offers"
}

@ -242,6 +242,23 @@
shellPath = /bin/sh;
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 */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
@ -274,23 +291,6 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
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 */
/* Begin PBXSourcesBuildPhase section */

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

@ -28,7 +28,7 @@ class ChatApiClient {
factory ChatApiClient() => _instance;
Future<user.UserAutoLoginModel> getUserLoginToken() async {
user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel();
user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel();
String? deviceToken = AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken;
Response response = await ApiClient().postJsonForResponse(
"${ApiConsts.chatLoginTokenUrl}externaluserlogin",

@ -1,6 +1,10 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:http/http.dart' as http;
import 'package:device_info_plus/device_info_plus.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/classes/consts.dart';
@ -12,7 +16,9 @@ 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/itg/itg_main_response.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';
@ -153,6 +159,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": "US",
};
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
Future<GenericResponseModel?> markAttendance({
String lat = "0",
@ -165,10 +224,17 @@ class DashboardApiClient {
}) async {
String url = "${ApiConsts.swpRest}AuthenticateAndSwipeUserSupportNFC";
var uuid = Uuid();
String? deviceId = "";
// Generate a v4 (random) id
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo;
deviceId = androidInfo.id;
} else if (Platform.isIOS) {
IosDeviceInfo iosInfo = await DeviceInfoPlugin().iosInfo;
deviceId = iosInfo.identifierForVendor;
}
Map<String, dynamic> postParams = {
"UID": await PlatformDeviceId.getDeviceId, //uuid.v4(), //Mobile Id
"UID": deviceId, //uuid.v4(), //Mobile Id
// "UID": uuid.v4(), //Mobile Id
"Latitude": lat,
"Longitude": long,

@ -90,8 +90,7 @@ class AppState {
String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.1, mobileType: Platform.isAndroid ? "android" : "ios");
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.2, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;

@ -66,4 +66,5 @@ class MyColors {
static const Color darkGrey3BColor = Color(0xff3B3B3B);
static const Color lightGreyIconColor = Color(0xff919191);
static const Color selectedBorderColor = Color(0xff37A4BE);
static const Color mazayaRedColor = Color(0xffED1C2B);
}

@ -6,15 +6,15 @@ class ApiConsts {
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// 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://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 = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
@ -27,6 +27,8 @@ class ApiConsts {
static String user = baseUrlServices + "api/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/";
static String ssoAuthRedirection = "https://sso-uat.hmg.com/api/auth/connect";
//Chat
static String chatServerBaseUrl = "https://apiderichat.hmg.com/";
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");
}
}

@ -34,8 +34,8 @@ class AppNotifications {
if (Platform.isIOS) {
await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
} else if (Platform.isAndroid) {
AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
bool? granted = await androidImplementation?.requestPermission();
AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
bool? granted = await androidImplementation?.requestNotificationsPermission();
if (granted == false) {
if (kDebugMode) {
print("-------------------- Permission Granted ------------------------");

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

@ -67,6 +67,7 @@ class OtpDialog {
// projectProvider = Provider.of(context);
return Dialog(
backgroundColor: Colors.white,
surfaceTintColor: Colors.transparent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
insetPadding: const EdgeInsets.only(left: 21, right: 21),
child: StatefulBuilder(builder: (context, setState) {
@ -202,8 +203,13 @@ class OtpDialog {
),
errorBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).colorScheme.error),
borderSide: BorderSide(color: Colors.red),
),
// focusedErrorBorder: OutlineInputBorder(
// borderRadius: const BorderRadius.all(Radius.circular(10.0)),
// borderSide: BorderSide(color: Colors.red),
// // borderSide: BorderSide(color: Theme.of(context).colorScheme.error),
// ),
focusedErrorBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).colorScheme.error),

@ -632,7 +632,8 @@ class CodegenLoader extends AssetLoader{
"explore": "يستكشف",
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين"
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya": "أعرض كل المزايا"
};
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1252,7 +1253,8 @@ static const Map<String,dynamic> _en_US = {
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees"
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya": "View All Offers"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -605,5 +605,6 @@ abstract class LocaleKeys {
static const mazaya = 'mazaya';
static const benefits = 'benefits';
static const mazayaDesc = 'mazayaDesc';
static const viewallofferMazaya = 'viewallofferMazaya';
}

@ -5,21 +5,21 @@ UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel.
String userAutoLoginModelToJson(UserAutoLoginModel data) => json.encode(data.toJson());
class UserAutoLoginModel {
UserAutoLoginModel({
this.response,
this.errorResponses,
});
UserAutoLoginModel({this.response, this.errorResponses, this.StatusCode});
Response? response;
List<ErrorResponse>? errorResponses;
int? StatusCode;
factory UserAutoLoginModel.fromJson(Map<String, dynamic> json) => UserAutoLoginModel(
response: json["response"] == null ? null : Response.fromJson(json["response"]),
StatusCode: json["StatusCode"],
errorResponses: json["errorResponses"] == null ? null : List<ErrorResponse>.from(json["errorResponses"].map((x) => ErrorResponse.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"response": response == null ? null : response!.toJson(),
"StatusCode": StatusCode,
"errorResponses": errorResponses == null ? null : List<dynamic>.from(errorResponses!.map((x) => x.toJson())),
};
}

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

@ -93,6 +93,12 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Future<void> getUserAutoLoginToken() async {
userLoginToken.UserAutoLoginModel userLoginResponse = await ChatApiClient().getUserLoginToken();
if (userLoginResponse.StatusCode == 500) {
disbaleChatForThisUser = true;
notifyListeners();
}
if (userLoginResponse.response != null) {
AppState().setchatUserDetails = userLoginResponse;
} else {
@ -399,8 +405,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
if (data.first.userChatReplyResponse != null) {
if (data.first.fileTypeResponse != null) {
if (data.first.userChatReplyResponse!.fileTypeId == 12 || data.first.userChatReplyResponse!.fileTypeId == 4 || data.first.userChatReplyResponse!.fileTypeId == 3) {
data.first.userChatReplyResponse!.image =
await ChatApiClient().downloadURL(fileName: data.first.userChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 1);
data.first.userChatReplyResponse!.image = await ChatApiClient()
.downloadURL(fileName: data.first.userChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 1);
data.first.userChatReplyResponse!.isImageLoaded = true;
}
}
@ -476,8 +482,8 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
if (data.first.groupChatReplyResponse != null) {
if (data.first.fileTypeResponse != null) {
if (data.first.groupChatReplyResponse!.fileTypeId == 12 || data.first.groupChatReplyResponse!.fileTypeId == 4 || data.first.groupChatReplyResponse!.fileTypeId == 3) {
data.first.groupChatReplyResponse!.image =
await ChatApiClient().downloadURL(fileName: data.first.groupChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 2);
data.first.groupChatReplyResponse!.image = await ChatApiClient()
.downloadURL(fileName: data.first.groupChatReplyResponse!.contant!, fileTypeDescription: data.first.fileTypeResponse!.fileTypeDescription ?? "image/jpg", fileSource: 2);
data.first.groupChatReplyResponse!.isImageLoaded = true;
}
}
@ -1653,7 +1659,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void sRecoding() async {
isVoiceMsg = true;
recorderController.reset();
await recorderController.record(path);
await recorderController.record(path: path);
_recodeDuration = 0;
_startTimer();
isRecoding = !isRecoding;
@ -1685,7 +1691,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
File file = File(path!);
file.readAsBytesSync();
path = file.path;
await playerController.preparePlayer(file.path, 1.0);
await playerController.preparePlayer(path:file.path, volume: 1.0);
_timer?.cancel();
notifyListeners();
}

@ -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/itg/itg_response_model.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';
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
@ -239,6 +240,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) {
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()));
}
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> menus = [];
for (int i = 0; i < getMenuEntriesList.length; i++) {
@ -316,8 +373,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
return res;
}
void notify() {
notifyListeners();
}

@ -16,84 +16,36 @@ class AppTheme {
},
),
hintColor: Colors.grey[400],
colorScheme: ColorScheme.fromSwatch(
accentColor: MyColors.backgroundColor,
errorColor: const Color.fromRGBO(235, 80, 60, 1.0),
),
colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor).copyWith(surfaceTint : Colors.transparent),
disabledColor: Colors.grey[300],
// errorColor: const Color.fromRGBO(235, 80, 60, 1.0),
applyElevationOverlayColor: false,
scaffoldBackgroundColor: MyColors.backgroundColor,
textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey),
canvasColor: Colors.white,
// backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: primaryColor,
primaryColorDark: primaryColor,
buttonTheme: ButtonThemeData(
buttonColor: Colors.black,
),
switchTheme: SwitchThemeData(
thumbColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return secondaryColor;
}
return null;
}),
trackColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return secondaryColor;
}
return null;
}),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return secondaryColor;
}
return null;
}),
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith<Color?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return null;
}
if (states.contains(MaterialState.selected)) {
return secondaryColor;
}
return null;
}),
),
// toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Color(0xFFE0E0E0),
),
primaryTextTheme: const TextTheme(
// bodyText2: TextStyle(color: Colors.white),
),
iconTheme: const IconThemeData(color: MyColors.darkIconColor),
textTheme: const TextTheme(
bodyMedium: TextStyle(color: Colors.black, letterSpacing: 0.6),
headlineSmall: TextStyle(color: Colors.white, letterSpacing: 0.6),
headlineMedium: TextStyle(color: Colors.white, letterSpacing: 0.6),
// bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6),
// headline1: TextStyle(color: Colors.white, letterSpacing: 0.6),
// headline2: TextStyle(color: Colors.white, letterSpacing: 0.6),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme(
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarBrightness: Brightness.light,
),
appBarTheme: AppBarTheme(
color: const Color(0xff515A5D),
systemOverlayStyle: const SystemUiOverlayStyle(statusBarBrightness: Brightness.light),
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],

@ -16,7 +16,7 @@ import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:month_picker_dialog_2/month_picker_dialog_2.dart';
import 'package:month_picker_dialog/month_picker_dialog.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
@ -301,6 +301,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
monthCellBuilder: (build, details) {
if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) {
int val = details.date.day;
int index = val-1;
//check day is off
// if (getDayHoursTypeDetailsList.isNotEmpty) {
// bool isDayIsOff = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF';
@ -310,9 +311,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
getDayHoursTypeDetailsList.where((GetDayHoursTypeDetailsList element) => DateFormat("MM/dd/yyyy", "en_US").parse(element.sCHEDULEDATE!).day == details.date.day).toList();
if (getDayHours.isNotEmpty) {
bool isDayIsOff = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[0].dAYTYPE == 'OFF';
bool isDayIsPresent = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = getDayHoursTypeDetailsList[0].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[0].aBSENTFLAG == 'Y';
bool isDayIsOff = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].dAYTYPE == 'OFF';
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y';
if (isDayIsOff) {
return Container(

@ -32,8 +32,11 @@ class _ChatHomeState extends State<ChatHome> {
@override
void initState() {
super.initState();
data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents();
if (chatHubConnection.state == HubConnectionState.Connected) {
data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents();
}
}
@override
@ -47,7 +50,6 @@ class _ChatHomeState extends State<ChatHome> {
data.getUserAutoLoginToken().whenComplete(() async {
await data.buildHubConnection();
data.getUserRecentChats();
});
return;
}
@ -57,7 +59,7 @@ class _ChatHomeState extends State<ChatHome> {
// String isAppOpendByChat = await Utils.getStringFromPrefs("isAppOpendByChat");
// String notificationData = await Utils.getStringFromPrefs("notificationData");
// if (isAppOpendByChat != "null" || isAppOpendByChat == "true" && notificationData != "null") {
// data.openChatByNoti(context);
// data.openChatByNoti(context);
// }
});
}

@ -214,8 +214,13 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
},
),
floatingActionButton: FloatingActionButton(
// <<<<<<< HEAD
// elevation: 0,
// backgroundColor : Colors.transparent,
// =======
backgroundColor: Colors.transparent,
elevation: 0,
child: Container(
width: 60,
height: 60,

@ -21,7 +21,6 @@ class BusinessCardDialog extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,

@ -60,10 +60,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void initState() {
WidgetsBinding.instance.addObserver(this);
super.initState();
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false);
marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
if (checkIfPrivilegedForChat()) {
_bHubCon();
}
@ -117,6 +117,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}
Future<void> checkHubCon() async {
// chatHubConnection = await context.read<ChatProviderModel>().getHubConnection();
if (chatHubConnection.state == HubConnectionState.Connected) {
await chatHubConnection.stop();
await chatHubConnection.start();
@ -151,7 +152,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries();
data.fetchEventActivity();
data.getCategoryOffersListAPI(context);
// data.getCategoryOffersListAPI(context);
marathonProvider.getMarathonDetailsFromApi();
marathonProvider.getMarathonTutorial();
if (isFromInit) {
@ -175,10 +176,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
if (list[ermIndex].notificationType == "Survey") {
await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first);
} else {
await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
"masterId": list[ermIndex].notificationMasterId,
"advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement,
});
await Navigator.pushNamed(
context,
AppRoutes.advertisement,
arguments: {"masterId": list[ermIndex].notificationMasterId, "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement},
);
}
}
ermIndex++;
@ -235,88 +237,84 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldState,
body: Column(
children: [
Row(
children: [
Builder(builder: (BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.memory(
Utils.dataFromBase64String(
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
),
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
return SvgPicture.asset(
"assets/images/user.svg",
height: 34,
return SafeArea(
bottom: Platform.isAndroid ? true : false,
top: false,
child: Scaffold(
key: _scaffoldState,
body: Column(
children: [
Row(
children: [
Builder(
builder: (BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.memory(
Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""),
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34);
},
width: 34,
);
},
width: 34,
height: 34,
fit: BoxFit.cover,
).circle(50),
// CircularAvatar(
// width: 34,
// height: 34,
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
// ),
8.width,
SvgPicture.asset("assets/images/side_nav.svg"),
],
).onPress(() {
_scaffoldState.currentState!.openDrawer();
});
}),
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
SvgPicture.asset(
"assets/images/announcements.svg",
matchTextDirection: true,
).onPress(() async {
await Navigator.pushNamed(context, AppRoutes.announcements);
})
],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _refreshController,
onRefresh: () {
_onRefresh(false);
},
child: SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height,
Row(
children: [
Expanded(
child: AspectRatio(
aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
height: 34,
fit: BoxFit.cover,
).circle(50),
// CircularAvatar(
// width: 34,
// height: 34,
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
// ),
8.width,
SvgPicture.asset("assets/images/side_nav.svg"),
],
).onPress(() {
_scaffoldState.currentState!.openDrawer();
});
},
),
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async {
await Navigator.pushNamed(context, AppRoutes.announcements);
}),
],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: false,
header: const MaterialClassicHeader(color: MyColors.gradiantEndColor),
controller: _refreshController,
onRefresh: () {
_onRefresh(false);
},
child: SingleChildScrollView(
child: Column(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
16.height,
Row(
children: [
Expanded(
child: AspectRatio(
aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
MyColors.gradiantEndColor,
MyColors.gradiantStartColor,
]),
gradient: const LinearGradient(
transform: GradientRotation(.46),
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
),
),
child: Stack(
alignment: Alignment.center,
@ -371,9 +369,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.toString()
.toText14(color: Colors.white, isBold: true),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
@ -384,19 +383,15 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Color(0xff259EA4),
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
@ -404,380 +399,257 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
),
],
),
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither();
},
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
.animatedSwither();
},
),
),
),
),
9.width,
Expanded(child: MenusWidget()),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
if (!model.isOffersLoading && model.getOffersList.isEmpty) {
return const SizedBox();
}
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? const TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
9.width,
Expanded(child: MenusWidget()),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
children: [
TextSpan(
text: 'اطلع على مميزات',
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: ' مزايا',
style: TextStyle(
fontSize: 16,
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
],
)
: TextSpan(
children: [
TextSpan(
text: LocaleKeys.explore.tr() + ' ',
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
TextSpan(
text: LocaleKeys.mazaya.tr(),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.2,
height: 24 / 16,
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
),
],
),
),
),
TextSpan(
text: ' ' + LocaleKeys.benefits.tr(),
style: const TextStyle(fontSize: 16, letterSpacing: -0.2,
fontFamily: 'Poppins',fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
),
],
),
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
// Container(
// height: 121,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// border: Border.all(width: 3, color: Colors.red),
// ),
// child: Padding(padding: const EdgeInsets.all(4.0), child: Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white))),
// ).paddingOnly(left: 21, right: 21, bottom: 21),
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// LocaleKeys.offers.tr().toText12(),
// Row(
// children: [
// LocaleKeys.discounts.tr().toText24(isBold: true),
// 6.width,
// Container(
// padding: const EdgeInsets.only(left: 8, right: 8),
// decoration: BoxDecoration(
// color: MyColors.yellowColor,
// borderRadius: BorderRadius.circular(10),
// ),
// child: LocaleKeys.newString.tr().toText10(isBold: true)),
// ],
// ),
// ],
// ),
// ),
// LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
// Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
// })
// ],
// ).paddingOnly(left: 21, right: 21),
// Consumer<DashboardProviderModel>(
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
// return SizedBox(
// height: 103 + 33,
// child: ListView.separated(
// shrinkWrap: true,
// physics: const BouncingScrollPhysics(),
// padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
// scrollDirection: Axis.horizontal,
// itemBuilder: (BuildContext cxt, int index) {
// return model.isOffersLoading
// ? const OffersShimmerWidget()
// : InkWell(
// onTap: () {
// navigateToDetails(data.getOffersList[index]);
// },
// child: SizedBox(
// width: 73,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// width: 73,
// height: 73,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: const BorderRadius.all(
// Radius.circular(100),
// ),
// border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
// ),
// child: ClipRRect(
// borderRadius: const BorderRadius.all(
// Radius.circular(50),
// ),
// child: Hero(
// tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
// transitionOnUserGestures: true,
// child: Image.network(
// data.getOffersList[index].logo ?? "",
// fit: BoxFit.contain,
// ),
// ),
// ),
// ),
// 4.height,
// Expanded(
// child: AppState().isArabic(context)
// ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
// : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
// ),
// ],
// ),
// ),
// );
// },
// separatorBuilder: (BuildContext cxt, int index) => 8.width,
// itemCount: 9),
// );
// },
// ),
),
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
),
],
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ServicesWidget(),
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 8, top: 8),
// context.watch<MarathonProvider>().isTutorialLoading
// ? const MarathonBannerShimmer().paddingAll(20)
// : Container(
// padding: EdgeInsets.only(bottom: 12, top: 12),
// margin: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 8),
// width: double.infinity,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: MyColors.backgroundBlackColor,
// borderRadius: BorderRadius.circular(20),
// border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// "Tutorial:",
// style: TextStyle(
// fontSize: 11,
// fontStyle: FontStyle.italic,
// fontWeight: FontWeight.w600,
// color: MyColors.white.withOpacity(0.83),
// letterSpacing: -0.4,
// ),
// ),
// Text(
// context.read<MarathonProvider>().tutorial?.tutorialName ?? "",
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontStyle: FontStyle.italic,
// fontSize: 19,
// fontWeight: FontWeight.bold,
// color: MyColors.white,
// height: 32 / 22,
// ),
// ),
// ],
// ),
// ).onPress(() {
// checkERMChannel();
// // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen);
// }),
],
),
),
],
),
),
),
),
],
),
drawer: AppDrawer(onLanguageChange: _onRefresh),
bottomNavigationBar: SizedBox(
height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()),
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.mowadhafhiRequest.tr(),
),
BottomNavigationBarItem(
icon: Stack(
alignment: Alignment.centerLeft,
children: [
SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.workListCounter == 0) {
return const SizedBox();
}
return Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ServicesWidget(),
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 8, top: 8),
// context.watch<MarathonProvider>().isTutorialLoading
// ? const MarathonBannerShimmer().paddingAll(20)
// : Container(
// padding: EdgeInsets.only(bottom: 12, top: 12),
// margin: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 8),
// width: double.infinity,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: MyColors.backgroundBlackColor,
// borderRadius: BorderRadius.circular(20),
// border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// "Tutorial:",
// style: TextStyle(
// fontSize: 11,
// fontStyle: FontStyle.italic,
// fontWeight: FontWeight.w600,
// color: MyColors.white.withOpacity(0.83),
// letterSpacing: -0.4,
// ),
// ),
// Text(
// context.read<MarathonProvider>().tutorial?.tutorialName ?? "",
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontStyle: FontStyle.italic,
// fontSize: 19,
// fontWeight: FontWeight.bold,
// color: MyColors.white,
// height: 32 / 22,
// ),
// ),
// ],
// ),
// ).onPress(() {
// checkERMChannel();
// // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen);
// }),
],
),
),
],
),
label: LocaleKeys.workList.tr(),
),
),
)
],
),
drawer: SafeArea(
child: AppDrawer(onLanguageChange: _onRefresh),
),
bottomNavigationBar: SizedBox(
height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/home.svg",
color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.home.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/create_req.svg",
color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.mowadhafhiRequest.tr(),
),
BottomNavigationBarItem(
icon: Stack(
alignment: Alignment.centerLeft,
children: [
SvgPicture.asset(
"assets/icons/work_list.svg",
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.workListCounter == 0) {
return const SizedBox();
}
return Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(),
),
label: LocaleKeys.workList.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg",
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(),
),
BottomNavigationBarItem(
icon: Stack(
alignment: Alignment.centerLeft,
children: [
SvgPicture.asset(
"assets/icons/chat/chat.svg",
color: !checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
).paddingAll(4),
Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return !checkIfPrivilegedForChat()
? const SizedBox()
: Positioned(
BottomNavigationBarItem(
icon: Stack(
alignment: Alignment.centerLeft,
children: [
SvgPicture.asset(
"assets/icons/chat/chat.svg",
color:
!checkIfPrivilegedForChat()
? MyColors.lightGreyE3Color
: currentIndex == 4
? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color
: MyColors.grey98Color,
).paddingAll(4),
Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return !checkIfPrivilegedForChat()
? const SizedBox()
: Positioned(
right: 0,
top: 0,
child: Container(
@ -787,34 +659,35 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
},
),
],
),
label: LocaleKeys.chat.tr(),
),
label: LocaleKeys.chat.tr(),
),
],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor,
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) {
if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.workList);
} else if (index == 3) {
Navigator.pushNamed(context, AppRoutes.itemsForSale);
} else if (index == 4) {
if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) {
Navigator.pushNamed(context, AppRoutes.chat);
],
currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor,
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) {
if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.workList);
} else if (index == 3) {
Navigator.pushNamed(context, AppRoutes.itemsForSale);
} else if (index == 4) {
if (!cProvider.disbaleChatForThisUser && checkIfPrivilegedForChat()) {
Navigator.pushNamed(context, AppRoutes.chat);
}
}
}
},
},
),
),
),
);
@ -824,8 +697,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
: (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive == true)
? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
: const SizedBox();
? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
: const SizedBox();
}
void navigateToDetails(OffersListModel offersListModelObj) {

@ -1,20 +1,56 @@
import 'dart:convert';
import 'dart:developer';
import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/svg.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/extensions/int_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/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/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/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/widgets/shimmer/dashboard_shimmer_widget.dart';
import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
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
Widget build(BuildContext context) {
List<String> namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()];
@ -26,7 +62,7 @@ class ServicesWidget extends StatelessWidget {
"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",
];
return Consumer<DashboardProviderModel>(
@ -34,72 +70,69 @@ class ServicesWidget extends StatelessWidget {
return data.isServicesMenusLoading
? whileLoading()
: ListView.separated(
padding: const EdgeInsets.only(top: 0),
itemBuilder: (context, parentIndex) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox(
height: 105 + 26,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return AspectRatio(
aspectRatio: 105 / 105,
child: data.isServicesMenusLoading
padding: const EdgeInsets.only(top: 0),
itemBuilder: (context, parentIndex) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
data.homeMenus![parentIndex].menuEntry.prompt!.toSectionHeading().paddingOnly(left: 21, right: 21),
SizedBox(
height: 105 + 26,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return AspectRatio(
aspectRatio: 105 / 105,
child:
data.isServicesMenusLoading
? ServicesMenuShimmer()
: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: const Color(0xff000000).withOpacity(.05),
blurRadius: 26,
offset: const Offset(0, -3),
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(AppState().isArabic(context)
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3))],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(
AppState().isArabic(context)
? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)
: getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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)),
],
)
],
).paddingOnly(left: 10, right: 10, bottom: 10, top: 12),
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
}),
);
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length),
: getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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)),
],
),
],
).paddingOnly(left: 10, right: 10, bottom: 10, top: 12),
).onPress(() {
handleOnPress(context, data.homeMenus![parentIndex].menuEntiesList[index]);
}),
);
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: data.homeMenus![parentIndex].menuEntiesList.length,
),
],
);
},
separatorBuilder: (context, index) {
return 12.height;
},
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: data.homeMenus!.length);
),
],
);
},
separatorBuilder: (context, index) {
return 12.height;
},
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: data.homeMenus!.length,
);
},
);
}
@ -196,7 +229,7 @@ class ServicesWidget extends StatelessWidget {
return returnImage;
}
void handleOnPress(context, GetMenuEntriesList menuEntry) {
Future<void> handleOnPress(context, GetMenuEntriesList menuEntry) async {
var pro = Provider.of<DashboardProviderModel>(context, listen: false);
if (menuEntry.requestType == "MONTHLY_ATTENDANCE") {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
@ -220,9 +253,28 @@ class ServicesWidget extends StatelessWidget {
Navigator.pushNamed(context, AppRoutes.monthlyPaySlip);
}
} 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));
if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
Utils.showLoading(context);
TicketBookingResult response = await pro.fetchTicketBooking();
Utils.hideLoading(context);
if (response.success) {
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId);
if (ssoToken != null) {
logger.d(ssoToken.data!.toJson());
logger.d(ssoToken.data!.accessToken);
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!)));
}
} 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;
}
@ -253,10 +305,7 @@ class ServicesWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return AspectRatio(
aspectRatio: 105 / 105,
child: ServicesMenuShimmer(),
);
return AspectRatio(aspectRatio: 105 / 105, child: ServicesMenuShimmer());
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: 4,

@ -4,8 +4,9 @@ import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:local_auth_darwin/local_auth_darwin.dart';
import 'package:local_auth_android/local_auth_android.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -65,6 +66,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return Scaffold(
appBar: AppBar(
surfaceTintColor: Colors.transparent,
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
@ -74,6 +76,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
: Container(),
actions: [
Center(
child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: EmployeeDigitialIdDialog());
}),
@ -204,15 +207,26 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
Future<bool> loginWithFaceIDAndBiometrics() async {
IOSAuthMessages iosStrings = const IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID',
);
IOSAuthMessages iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
// IOSAuthMessages iosStrings = const IOSAuthMessages(
// cancelButton: 'cancel',
// goToSettingsButton: 'settings',
// goToSettingsDescription: 'Please set up your Touch ID.',
// lockOut: 'Please reenable your Touch ID',
// );
bool authenticated = false;
try {
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings);
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', options: const AuthenticationOptions(
useErrorDialogs: true, stickyAuth: true, biometricOnly: true,
),
authMessages: [
iosStrings,
const AndroidAuthMessages(),
],
);
} on PlatformException catch (e) {
print(e);
Utils.hideLoading(context);
@ -222,8 +236,22 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) ||
_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.face));
// <<<<<<< HEAD
bool isDisable = false;
if(_flag >= 3 && _flag <= 4) {
bool isFaceEnabled = (_flag == 3 && (checkBiometricIsAvailable(BiometricType.face) ||
checkBiometricIsAvailable(BiometricType.weak)));
bool isThumbEnabled =
(_flag == 4 && (checkBiometricIsAvailable(BiometricType.fingerprint) ||
checkBiometricIsAvailable(BiometricType.strong)));
isDisable = !(isFaceEnabled || isThumbEnabled);
}
// =======
// bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) ||
// _flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.face));
// // >>>>>>> master
return InkWell(
onTap: isDisable
? null

@ -4,7 +4,8 @@ import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth_darwin/local_auth_darwin.dart';
import 'package:local_auth_android/local_auth_android.dart';
import 'package:local_auth/local_auth.dart';
import 'package:mohem_flutter_app/api/login_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -517,7 +518,11 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
bool authenticated = false;
try {
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings);
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate',
options: const AuthenticationOptions(useErrorDialogs: true, stickyAuth: true, biometricOnly: true,), authMessages: [
iosStrings,
const AndroidAuthMessages(),
],);
} on PlatformException catch (e) {
print(e);
Utils.hideLoading(context);
@ -527,25 +532,17 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = (_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) ||
_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.face));
// bool isDisable = false;
// switch (_flag) {
// case 3:
// isDisable = !(checkBiometricIsAvailable(BiometricType.face) ||
// checkBiometricIsAvailable(BiometricType.weak));
// break;
// case 4:
// isDisable = !(checkBiometricIsAvailable(BiometricType.fingerprint) ||
// checkBiometricIsAvailable(BiometricType.strong));
// break;
// }
// // bool isDisable = ((_flag == 3 &&
// // (!checkBiometricIsAvailable(BiometricType.face) ||
// // !checkBiometricIsAvailable(BiometricType.weak))) ||
// // (_flag == 4 &&
// // (!checkBiometricIsAvailable(BiometricType.fingerprint) ||
// // !checkBiometricIsAvailable(BiometricType.strong))));
bool isDisable = false;
if(_flag >= 3 && _flag <= 4) {
bool isFaceEnabled = (_flag == 3 && (checkBiometricIsAvailable(BiometricType.face) ||
checkBiometricIsAvailable(BiometricType.weak)));
bool isThumbEnabled =
(_flag == 4 && (checkBiometricIsAvailable(BiometricType.fingerprint) ||
checkBiometricIsAvailable(BiometricType.strong)));
isDisable = !(isFaceEnabled || isThumbEnabled);
}
return InkWell(
onTap: isDisable
? null

@ -15,7 +15,7 @@ import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:month_picker_dialog_2/month_picker_dialog_2.dart';
import 'package:month_picker_dialog/month_picker_dialog.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';

@ -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/widgets/app_bar_widget.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';
class OffersAndDiscountsDetails extends StatefulWidget {
@ -61,13 +61,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
// transitionOnUserGestures: true,
child: RepaintBoundary(
key: _globalKey,
child: ClipRRect(
borderRadius: BorderRadius.circular(6),
child: Image.network(
getOffersList[0].bannerImage ?? "",
fit: BoxFit.contain,
),
).paddingAll(12),
child: ClipRRect(borderRadius: BorderRadius.circular(6), child: Image.network(getOffersList[0].bannerImage ?? "", fit: BoxFit.contain)).paddingAll(12),
),
),
8.height,
@ -76,7 +70,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
: getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center,
Html(
data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "",
onLinkTap: (String? url, context, Map<String, String> attributes, _) {
onLinkTap: (String? url, Map<String, String> attributes, _) {
launchUrl(Uri.parse(url!));
},
),
@ -87,19 +81,20 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
children: [
getOffersList[0].discountDescription!.toText16(isBold: true),
InkWell(
onTap: () {
_shareOfferAsImage();
},
child: const Icon(Icons.share, color: MyColors.darkIconColor).paddingOnly(bottom: 4))
onTap: () {
_shareOfferAsImage();
},
child: const Icon(Icons.share, color: MyColors.darkIconColor).paddingOnly(bottom: 4),
),
],
).paddingOnly(left: 8, right: 8),
getOffersList[0].isHasLocation == "true"
? InkWell(
onTap: () {},
child: Row(
children: [const Icon(Icons.map_sharp, color: MyColors.darkIconColor).paddingOnly(bottom: 4), "Offer Location".toText16(isUnderLine: true).paddingOnly(left: 8)],
).paddingOnly(left: 8, right: 8, top: 8),
)
onTap: () {},
child: Row(
children: [const Icon(Icons.map_sharp, color: MyColors.darkIconColor).paddingOnly(bottom: 4), "Offer Location".toText16(isUnderLine: true).paddingOnly(left: 8)],
).paddingOnly(left: 8, right: 8, top: 8),
)
: 12.height,
],
).objectContainerView().paddingOnly(left: 21, right: 21, top: 21),
@ -127,18 +122,14 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
Directory tempDir = await getTemporaryDirectory();
File file = await File('${tempDir.path}/${DateTime.now().toString()}.png').create();
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) {
debugPrint(ex.toString());
}
}
void _scrollToTop() {
_scrollController.animateTo(
0,
duration: const Duration(milliseconds: 500),
curve: Curves.linear,
);
_scrollController.animateTo(0, duration: const Duration(milliseconds: 500), curve: Curves.linear);
}
List<Widget> getItemsForSaleWidgets() {
@ -155,18 +146,9 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
mainAxisSize: MainAxisSize.min,
children: [
Hero(
tag: "ItemImage" + getOffersList.offersDiscountId.toString()!,
tag: "ItemImage" + getOffersList.offersDiscountId.toString(),
transitionOnUserGestures: true,
child: AspectRatio(
aspectRatio: 148 / 127,
child: ClipRRect(
borderRadius: BorderRadius.circular(6),
child: Image.network(
getOffersList.bannerImage ?? "",
fit: BoxFit.contain,
),
),
),
child: AspectRatio(aspectRatio: 148 / 127, child: ClipRRect(borderRadius: BorderRadius.circular(6), child: Image.network(getOffersList.bannerImage ?? "", fit: BoxFit.contain))),
),
5.height,
getOffersList.titleEn!.toText16(isBold: true, color: const Color(0xff2B353E), maxlines: 1),
@ -180,10 +162,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
// 16.height,
getOffersList.discountDescription!.toText14(isBold: true, maxlines: 1),
8.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)],
),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [checkDate(getOffersList.endDate!), SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4)]),
],
).objectContainerView().onPress(() {
this.getOffersList[0] = getOffersList;

File diff suppressed because one or more lines are too long

@ -61,6 +61,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
int animationIndex = 0;
PageController controller = PageController();
bool showFabOptions = false;
bool isShowActions = false;
WorkListResponseModel? workListData;
MemberInformationListModel? memberInformationListModel;
@ -286,6 +287,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
: ActionsFragment(
workListData!.nOTIFICATIONID,
actionHistoryList,
isShowActions,
voidCallback: reloadWorkList,
)
: showLoadingAnimation(),
@ -713,7 +715,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
"RespondAttributeList": responseAttribute,
};
if (actionMode == "APPROVED" ||
actionMode == "APPROVE" ||
actionMode == "CLOSE" ||
@ -1078,6 +1079,14 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
return false;
});
if(notificationButtonsList.any((GetNotificationButtonsList element) => element.bUTTONACTION == "DELEGATE" || element.bUTTONACTION == "REQUEST_INFO" )) {
isShowActions = true;
} else {
isShowActions = false;
}
}
apiCallCount--;
if (apiCallCount == 0) {

@ -17,8 +17,9 @@ class ActionsFragment extends StatelessWidget {
int? notificationID;
List<GetActionHistoryList> actionHistoryList;
VoidCallback voidCallback;
bool isShowActions = false;
ActionsFragment(this.notificationID, this.actionHistoryList, {Key? key, required this.voidCallback}) : super(key: key);
ActionsFragment(this.notificationID, this.actionHistoryList, this.isShowActions, {Key? key, required this.voidCallback}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -113,42 +114,41 @@ class ActionsFragment extends StatelessWidget {
],
).paddingOnly(top: 19, left: 16, right: 16, bottom: 12),
Container(width: double.infinity, height: 1, color: MyColors.lightGreyEFColor),
Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory),
);
}).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) {
showMyBottomSheet(context,
isShowActions
? Row(
children: [
LocaleKeys.request_info.tr().toText12(color: MyColors.grey67Color).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: DelegateSheet(
title: LocaleKeys.delegate.tr(),
apiMode: "DELEGATE",
notificationID: notificationID,
actionHistoryList: actionHistoryList,
child: SelectedItemSheet(LocaleKeys.request_info.tr(), apiMode: "REQUEST_INFO", notificationID: notificationID, actionHistoryList: actionHistory),
);
}).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
if (actionHistory.uSERNAME == AppState().memberInformationList?.eMPLOYEENUMBER) {
showMyBottomSheet(
context,
callBackFunc: voidCallback,
));
return;
}
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: "DELEGATE",
actionHistoryList: actionHistory,
notificationID: notificationID,
),
);
}).expanded,
],
),
child: DelegateSheet(
title: LocaleKeys.delegate.tr(),
apiMode: "DELEGATE",
notificationID: notificationID,
actionHistoryList: actionHistoryList,
callBackFunc: voidCallback,
),
);
return;
}
showMyBottomSheet(
context,
callBackFunc: voidCallback,
child: SelectedItemSheet(LocaleKeys.comments.tr(), apiMode: "DELEGATE", actionHistoryList: actionHistory, notificationID: notificationID),
);
}).expanded,
],
)
: const SizedBox(),
],
),
],

@ -760,6 +760,18 @@ class InfoFragment extends StatelessWidget {
ItemDetailViewCol(
LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.preparePositionName.tr(),
data.paymentDetailsList![0].preparePositionName ?? ""),
ItemDetailViewCol(
LocaleKeys.requesterPositionName.tr(), data.paymentDetailsList![0].requesterPositionName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.prepareEmpName.tr(),
data.paymentDetailsList![0].prepareEmployeeName ?? ""),
ItemDetailViewCol(
LocaleKeys.requesterPayrollName.tr(), data.paymentDetailsList![0].requesterPayrollName ?? ""),
),
ItemDetailGrid(
ItemDetailViewCol( LocaleKeys.preparePositionName.tr(),
data.paymentDetailsList![0].preparePositionName ?? ""),
@ -897,15 +909,18 @@ class InfoFragment extends StatelessWidget {
),
ItemDetailGrid(
ItemDetailViewCol(LocaleKeys.invoiceDate.tr(),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""),
DateUtil.formatDateToDate(
DateUtil.convertStringToDate( data.refundInvoiceList![0].invoicedDate), false)?? ""),
ItemDetailViewCol( LocaleKeys.refundInvoice.tr(), data.refundInvoiceList![0].invoiceNumber ??
"" ),
),
],
).objectContainerView(),
],
],
);
}
}

@ -20,8 +20,8 @@ AppBar AppBarWidget(
}) {
return AppBar(
leadingWidth: 0,
automaticallyImplyLeading: false,
surfaceTintColor: Colors.transparent,
title: Row(
children: [
GestureDetector(

@ -13,6 +13,8 @@ AppBar ChatAppBarWidget(BuildContext context,
{required String title, bool showHomeButton = true, ChatUser? chatUser, bool showTyping = false, List<Widget>? actions, void Function()? onHomeTapped, void Function()? onBackTapped}) {
return AppBar(
leadingWidth: 0,
automaticallyImplyLeading: false,
surfaceTintColor: Colors.transparent,
title: Consumer<ChatProviderModel>(builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return Row(
children: [

@ -159,7 +159,7 @@ class _BottomSheet extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 12.0),
decoration: BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor, borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
decoration: BoxDecoration( borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
child: SafeArea(
top: false,
child: Column(

@ -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:nfc_manager/nfc_manager.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:platform_device_id/platform_device_id.dart';
import 'package:wifi_iot/wifi_iot.dart';
class MarkAttendanceWidget extends StatefulWidget {

@ -78,10 +78,10 @@ class _NfcLayoutState extends State<NfcLayout> {
}
Widget scanNfc() {
return SizedBox(
width: MediaQuery.of(context).size.width,
return Container(
key: ValueKey(1),
width: double.infinity,
child: Column(
key: ValueKey(1),
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
@ -139,9 +139,8 @@ class _NfcLayoutState extends State<NfcLayout> {
Widget doneNfc() {
return Container(
width: MediaQuery.of(context).size.width,
key: ValueKey(2),
child: Column(
key: ValueKey(2),
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(

@ -1,8 +1,8 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:qr_code_scanner/qr_code_scanner.dart';
class QrScannerDialog extends StatefulWidget {
@override
@ -11,8 +11,9 @@ class QrScannerDialog extends StatefulWidget {
class _QrScannerDialogState extends State<QrScannerDialog> {
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
Barcode? result;
QRViewController? controller;
// Barcode? result;
// QRViewController? controller;
Barcode? _barcode;
bool isPicked = false;
@override
@ -26,10 +27,7 @@ class _QrScannerDialogState extends State<QrScannerDialog> {
children: [
Expanded(
flex: 1,
child: QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
),
child: MobileScanner(key : qrKey,onDetect: _handleBarcode),
),
// Expanded(
// flex: 1,
@ -55,25 +53,25 @@ class _QrScannerDialogState extends State<QrScannerDialog> {
);
}
void _onQRViewCreated(QRViewController controller) {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {
void _handleBarcode(BarcodeCapture barcodes) {
// this.controller = controller;
Barcode? data = barcodes.barcodes.firstOrNull;
if(data == null || isPicked) {
return;
}
// controller.scannedDataStream.listen((scanData) {
setState(() {
result = scanData;
if (!isPicked) {
// result = scanData;
isPicked = true;
Navigator.pop(context, result!.code);
}
Navigator.pop(context, data.displayValue);
});
});
controller.pauseCamera();
controller.resumeCamera();
// });
// controller.pauseCamera();
// controller.resumeCamera();
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}

@ -0,0 +1,61 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class SsoLoginWebView extends StatefulWidget {
final String url;
final String jwtToken;
SsoLoginWebView({required this.url, required this.jwtToken});
@override
State<SsoLoginWebView> createState() => _SsoLoginWebViewState();
}
class _SsoLoginWebViewState extends State<SsoLoginWebView> {
late final WebViewController _controller;
@override
void initState() {
// TODO: implement initState
super.initState();
_controller =
WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
print("WebView is loading (progress: $progress%)");
},
onPageStarted: (String url) {
print("Page started loading: $url");
},
onPageFinished: (String url) {
print("Page finished loading: $url");
},
onHttpError: (HttpResponseError error) {
print("HTTP error: ${error.toString()} for URL: ${error.response!.statusCode}");
},
onWebResourceError: (WebResourceError error) {
print("Web resource error: ${error.description} for URL: ${error.errorType}");
},
),
)
..loadHtmlString('''
<!DOCTYPE html>
<html>
<body onload="document.forms[0].submit()">
<form method="POST" action="https://ek.techmaster.in/SSO/HMG">
<input type="hidden" name="JWTToken" value="${widget.jwtToken}" />
</form>
<h1>Redirecting...</h1>
</body>
</html>''');
}
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBar(title: Text('Logging in...')), body: WebViewWidget(controller: _controller));
}
}

@ -17,11 +17,11 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.6.6+300076
#version: 3.8.999+2
version: 3.6.7+300077
#version: 3.9.0+1
environment:
sdk: ">=2.16.0 <3.0.0"
sdk: ^3.7.0
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@ -41,44 +41,42 @@ dependencies:
injector: ^2.0.0
provider: ^6.0.1
easy_localization: ^3.0.0
http: ^0.13.4
permission_handler: ^10.2.0
http: ^1.4.0
permission_handler: ^12.0.1
flutter_svg: any
sizer: ^2.0.15
local_auth: ^1.1.9
local_auth: ^2.3.0
fluttertoast: ^8.0.8
syncfusion_flutter_calendar: ^19.4.48
syncfusion_flutter_calendar: ^29.1.38
# flutter_calendar_carousel: ^2.1.0
pie_chart: ^5.1.0
shared_preferences: ^2.0.12
firebase_messaging: ^13.0.4
firebase_messaging: ^15.2.9
shimmer: ^2.0.0
logger: ^1.1.0
flutter_countdown_timer: ^4.1.0
nfc_manager: ^3.2.0
# uuid: ^3.0.6
# device_info_plus: ^4.0.0
# android_id: ^0.1.3+1
platform_device_id: ^1.0.1
platform_device_id_plus: ^1.0.7
device_info_plus: ^11.5.0
image_picker: ^0.8.5+3
file_picker: 5.2.5
geolocator: ^11.1.0
month_year_picker: ^0.2.0+1
month_picker_dialog_2: ^0.5.5
# month_picker_dialog: ^6.2.3
# open_file: ^3.2.1
open_filex: ^4.4.0
file_picker: ^8.3.1
geolocator: ^9.0.2
month_year_picker: ^0.5.0+1
month_picker_dialog: ^6.0.3
# open_file: ^3.2.1
open_filex: ^4.6.0
wifi_iot: ^0.3.19+1
flutter_html: ^3.0.0-alpha.6
mobile_scanner: ^6.0.10
# flutter_barcode_scanner: ^2.0.0
qr_code_scanner: ^1.0.1
# qr_code_scanner: ^1.0.1
# qr_flutter: ^4.0.0
url_launcher: ^6.0.15
share: 2.0.4
share_plus: ^11.0.0
flutter_rating_bar: ^4.0.1
auto_size_text: ^3.0.0
pull_to_refresh: ^2.0.0
fl_chart: ^0.62.0
fl_chart: ^0.66.0
# lottie json animations
lottie: any
# Marathon Card Swipe
@ -93,13 +91,13 @@ dependencies:
signalr_netcore: ^1.3.3
logging: ^1.0.1
swipe_to: ^1.0.2
flutter_webrtc: ^0.9.17
flutter_webrtc: ^0.12.11
camera: ^0.10.3
flutter_local_notifications: ^10.0.0
flutter_local_notifications: ^18.0.1
#firebase_analytics: any
#Chat Voice Message Recoding & Play
audio_waveforms: ^0.1.5+1
audio_waveforms: ^1.3.0
rxdart: ^0.27.7
#Encryption
@ -112,28 +110,41 @@ dependencies:
#Huawei Dependencies
# huawei_hmsavailability: ^6.6.0+300
# huawei_location: 6.0.0+302
huawei_location: ^6.11.0+301
huawei_push: ^6.7.0+300
firebase_crashlytics: ^2.9.0
# huawei_location: 6.0.0+302
huawei_location: ^6.14.2+301
# huawei_push: ^6.7.0+300
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
carousel_slider: ^4.2.1
carousel_slider: ^5.1.1
#Huawei Specified
# store_checker: ^1.1.0
google_api_availability: ^3.0.1
google_api_availability: ^5.0.1
google_maps_flutter_web: ^0.5.4
in_app_update: 4.1.0
flutter_inappwebview: ^6.1.5
flutter_blurhash: ^0.8.0
#todo its for temporary purpose, later will remove this.
dotted_border: ^2.0.0+3
webview_flutter: ^4.13.0
# saf: ^1.0.3+4
dependency_overrides:
firebase_core_platform_interface: 4.5.1
nfc_manager: ^3.2.0
# firebase_core_platform_interface: 4.5.1
dev_dependencies:
@ -230,4 +241,4 @@ flutter:
# see https://flutter.dev/custom-fonts/#from-packages
# Adding this to test the push from iMac
# Adding this to test the push from iMac

Loading…
Cancel
Save