Merge branch 'master_mohemm_flutter' into mohemm_HMG_flutter_upgrade

# Conflicts:
#	lib/app_state/app_state.dart
#	lib/classes/consts.dart
#	lib/ui/landing/dashboard_screen.dart
#	pubspec.yaml
mohemm_HMG_flutter_upgrade
haroon amjad 3 months ago
commit f6df04c432

@ -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 "com.cloudsolutions.alhabibmohemm"
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"

@ -0,0 +1,17 @@
<svg width="90" height="47" viewBox="0 0 90 47" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.6637 23.3332H6.12992C4.29216 23.3332 3.22754 22.3002 3.22754 20.584V12.585H5.6329V19.3679C5.6329 20.5007 5.92436 21.102 7.69463 21.102H14.6668V23.3347L14.6637 23.3332Z" fill="#5D5E5E"/>
<path d="M15.7284 26.0988H13.5991V24.1653H15.7284V26.0988ZM19.1293 20.1166C19.1293 20.9993 18.8716 21.7331 18.373 22.3166C17.8054 22.9998 17.0154 23.3332 16.0198 23.3332H13.9765V21.1005H15.5044C16.3113 21.1005 16.7239 20.5498 16.7239 19.4677V15.7837H19.1293V20.1166ZM18.9744 26.0988H16.8283V24.1653H18.9744V26.0988Z" fill="#5D5E5E"/>
<path d="M23.2848 23.3332H20.8794V12.5835H23.2848V23.3332Z" fill="#5D5E5E"/>
<path d="M32.285 23.3335H29.6219C29.2261 25.1673 27.6813 26.0827 24.9492 26.0827V24.1998C26.5293 24.1998 27.3193 23.4659 27.3193 21.9998V15.7839H29.7415V21.1008H32.2834V23.3335H32.285ZM29.5881 14.5172H27.4589V12.6001H29.5881V14.5172Z" fill="#5D5E5E"/>
<path d="M41.868 20.9665C41.868 23.1992 40.3217 24.7666 37.9179 24.7666C36.4575 24.7666 35.3592 24.2828 34.655 23.3332H31.564V21.1005H33.9509C33.9509 18.7174 35.3592 17.2007 37.832 17.2007C40.3049 17.2007 41.868 18.6832 41.868 20.9665ZM39.4811 21.0499C39.4811 19.7326 38.9657 19.0672 37.9532 19.0672H37.7814C36.9055 19.0672 36.3041 19.8502 36.3041 20.9501C36.3041 22.0501 36.8886 22.8673 37.9179 22.8673C38.8629 22.8673 39.4811 22.1335 39.4811 21.0514V21.0499Z" fill="#5D5E5E"/>
<path d="M79.3108 4.83447H54.3276C50.4719 4.83447 47.3462 7.86731 47.3462 11.6085V35.8498C47.3462 39.591 50.4719 42.6238 54.3276 42.6238H79.3108C83.1665 42.6238 86.2921 39.591 86.2921 35.8498V11.6085C86.2921 7.86731 83.1665 4.83447 79.3108 4.83447Z" fill="#ED1C2B"/>
<path d="M81.526 29.9599L81.5045 37.6687L71.1253 37.6419C70.1972 37.6419 69.5575 36.7473 69.5145 35.3794C69.5161 33.233 68.858 31.1209 67.5586 29.3824C65.1119 26.1077 61.6603 23.485 57.1748 21.5337C56.0672 21.0529 54.8645 20.8073 53.6527 20.8117C52.697 20.7522 52.0542 19.6939 52.0542 18.3662L52.0573 10.6812L62.2908 10.6782C63.2158 10.6782 63.9491 11.6026 63.992 12.9675C63.9905 14.4575 64.4108 15.9251 65.2453 17.1754C68.0403 21.3699 71.6146 24.7309 76.3885 26.8147C77.4946 27.297 78.6988 27.5367 79.9122 27.5441C80.8679 27.6036 81.526 28.6322 81.526 29.9599Z" fill="white"/>
<path d="M64.0242 28.7545C64.015 28.8631 64.0104 28.9733 64.0104 29.0864L64.0012 34.4211V35.3425C63.9537 36.7104 63.1867 37.6585 62.2632 37.6585L54.5332 37.6273C53.5146 37.6273 52.068 37.6362 52.068 37.6362L52.0542 29.8961C52.0542 28.5714 52.6985 27.5176 53.6573 27.4565L56.5274 27.461H57.6273H62.5884C63.2557 27.461 63.8233 28.0028 64.0258 28.7545H64.0242Z" fill="white"/>
<path d="M81.5779 8.74026L81.5641 18.3826C81.5641 19.7103 80.9444 20.8013 79.9887 20.8594L77.0832 20.852L76.106 20.849C76.0385 20.8371 75.9695 20.8326 75.9005 20.8326H70.9486C70.2936 20.8326 69.7337 20.3102 69.522 19.5793C69.5358 19.4602 69.5465 19.3367 69.5496 19.2102V13.0241C69.5925 11.6517 70.3626 10.6842 71.283 10.6842L78.3534 10.6902C80.4918 10.5815 81.5748 8.73877 81.5748 8.73877L81.5779 8.74026Z" fill="white"/>
<path d="M9.65051 32.5902C9.62289 31.8728 9.59528 31.005 9.59528 30.1387H9.56767C9.37591 30.8993 9.12126 31.7492 8.88349 32.4488L8.13488 34.7768H7.04879L6.39223 32.4667C6.19127 31.7671 5.98111 30.9172 5.83537 30.1387H5.81696C5.78015 30.9439 5.75254 31.8653 5.70651 32.6081L5.5976 34.8735H4.31055L4.70326 28.9077H6.55483L7.15617 30.8993C7.34793 31.5899 7.53968 32.3342 7.67621 33.0323H7.70382C7.87717 32.3416 8.08733 31.5542 8.28829 30.8904L8.94485 28.9077H10.7596L11.0971 34.8735H9.73794L9.64744 32.5902H9.65051Z" fill="#5D5E5E"/>
<path d="M13.7557 33.3433L13.3185 34.875H11.8765L13.7557 28.9092H15.5796L17.4864 34.875H15.9907L15.5167 33.3433H13.7557ZM15.3158 32.3342L14.9323 31.069C14.8233 30.7147 14.7129 30.2726 14.6224 29.9184H14.604C14.5119 30.2726 14.4214 30.7236 14.3217 31.069L13.9566 32.3342H15.3158Z" fill="#5D5E5E"/>
<path d="M18.8135 34.1486L21.814 30.0583V30.0226H18.8135V28.9077H23.6641V29.6862L20.7295 33.7229V33.7586H23.7116V34.8735H18.8135V34.1471V34.1486Z" fill="#5D5E5E"/>
<path d="M26.9051 33.3433L26.4679 34.875H25.0259L26.9051 28.9092H28.729L30.6358 34.875H29.1401L28.6661 33.3433H26.9051ZM28.4652 32.3342L28.0817 31.069C27.9712 30.7147 27.8623 30.2726 27.7718 29.9184H27.7534C27.6613 30.2726 27.5708 30.7236 27.4711 31.069L27.106 32.3342H28.4652Z" fill="#5D5E5E"/>
<path d="M32.1961 34.875V32.4324L30.2524 28.9092H31.8402L32.4691 30.3441C32.6609 30.7772 32.7882 31.0972 32.9431 31.4857H32.9615C33.0981 31.1136 33.2438 30.7683 33.4263 30.3441L34.0461 28.9092H35.6062L33.5813 32.3877V34.875H32.1945H32.1961Z" fill="#5D5E5E"/>
<path d="M37.0496 33.3433L36.6124 34.875H35.1704L37.0496 28.9092H38.8736L40.7804 34.875H39.2847L38.8107 33.3433H37.0496ZM38.6097 32.3342L38.2262 31.069C38.1157 30.7147 38.0068 30.2726 37.9163 29.9184H37.8979C37.8059 30.2726 37.7154 30.7236 37.6157 31.069L37.2506 32.3342H38.6097Z" fill="#5D5E5E"/>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

@ -612,5 +612,10 @@
"searchByUserName": "البحث بواسطة اسم المستخدم",
"shareScreen": "مشاركة الشاشة",
"start":"يبدأ",
"about":"عن"
"about":"عن",
"explore": "يستكشف",
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya" : "أعرض كل المزايا"
}

@ -612,5 +612,11 @@
"bonusQty": "Bonus Qty.",
"balQty": "Bal. Qty.",
"start":"Start",
"about":"About"
"about":"About",
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"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,7 +90,7 @@ class AppState {
String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, versionID: 9.0, mobileType: Platform.isAndroid ? "android" : "ios");
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 33, 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);
}

@ -11,10 +11,10 @@ class ApiConsts {
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),

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters
// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters, constant_identifier_names
import 'dart:ui';
@ -14,7 +14,7 @@ class CodegenLoader extends AssetLoader{
return Future.value(mapLocales[locale.toString()]);
}
static const Map<String,dynamic> ar_SA = {
static const Map<String,dynamic> _ar_SA = {
"mohemm": "Mohemm",
"english": "English",
"arabic": "عربي",
@ -116,6 +116,7 @@ class CodegenLoader extends AssetLoader{
"reject": "يرفض",
"approve": "يوافق",
"cancel": "إلغاء",
"generate": "يولد",
"requestedItems": "العناصر المطلوبة",
"request": "طلب",
"myRequest": "طلبي",
@ -560,10 +561,9 @@ class CodegenLoader extends AssetLoader{
"missingDocuments": "مستندات مفقودة",
"uploadedDocuments": "المستندات التي تم تحميلها",
"addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.",
"open": "يفتح",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
"generate": "يولد",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"open": "يفتح",
"paymentRequest": "طلب الدفع",
"paymentDetails": "تفاصيل الدفع",
"requestNo": "رقم الطلب",
@ -627,10 +627,15 @@ class CodegenLoader extends AssetLoader{
"members": "الأعضاء",
"searchByUserName": "البحث بواسطة اسم المستخدم",
"shareScreen": "مشاركة الشاشة",
"start":"يبدأ",
"about":"عن"
"start": "يبدأ",
"about": "عن",
"explore": "يستكشف",
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya": "أعرض كل المزايا"
};
static const Map<String,dynamic> en_US = {
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
"english": "English",
"arabic": "عربي",
@ -725,6 +730,7 @@ static const Map<String,dynamic> en_US = {
"whatsapp": "Whatsapp",
"reject": "Reject",
"approve": "Approve",
"generate": "Generate",
"cancel": "Cancel",
"requestedItems": "Requested Items",
"request": "Request",
@ -1197,7 +1203,6 @@ static const Map<String,dynamic> en_US = {
"pleaseClickButtonToJoinMarathon": "Press the button below to join the Marathon.",
"youCannotJoinTheMarathon": "You cannot join the Marathon because you have exceeded the time limit.",
"requesterOperatingUnit": "Requester Operating Unit",
"generate": "Generate",
"paymentRequest": "Pay Request",
"paymentDetails": "Payment Details",
"requestNo": "Request No",
@ -1243,8 +1248,13 @@ static const Map<String,dynamic> en_US = {
"qtyReceived": "Qty. Received",
"bonusQty": "Bonus Qty.",
"balQty": "Bal. Qty.",
"start":"Start",
"about":"About"
"start": "Start",
"about": "About",
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"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};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -1,5 +1,7 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
// ignore_for_file: constant_identifier_names
abstract class LocaleKeys {
static const mohemm = 'mohemm';
static const english = 'english';
@ -101,6 +103,7 @@ abstract class LocaleKeys {
static const reject = 'reject';
static const approve = 'approve';
static const cancel = 'cancel';
static const generate = 'generate';
static const requestedItems = 'requestedItems';
static const request = 'request';
static const myRequest = 'myRequest';
@ -530,10 +533,9 @@ abstract class LocaleKeys {
static const missingDocuments = 'missingDocuments';
static const uploadedDocuments = 'uploadedDocuments';
static const addAtLeastOneAttachment = 'addAtLeastOneAttachment';
static const open = 'open';
static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon';
static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon';
static const generate = 'generate';
static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon';
static const open = 'open';
static const paymentRequest = 'paymentRequest';
static const paymentDetails = 'paymentDetails';
static const requestNo = 'requestNo';
@ -598,5 +600,11 @@ abstract class LocaleKeys {
static const searchByUserName = 'searchByUserName';
static const shareScreen = 'shareScreen';
static const start = 'start';
static const about ='about';
static const about = 'about';
static const explore = 'explore';
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,

@ -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,324 +399,306 @@ 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(
9.width,
Expanded(child: MenusWidget()),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
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(
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()),
],
),
child: LocaleKeys.newString.tr().toText10(isBold: true)),
],
),
],
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.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
),
),
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);
// }),
],
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),
),
);
},
),
],
),
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(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
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(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
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);
}
}
}
},
},
),
),
),
);
}
bool checkIfPrivilegedForChat() {
for (PrivilegeListModel element in AppState().privilegeListModel!) {
if (element.serviceName?.toLowerCase() == "chat") {
if (element.previlege != null) {
return element.previlege!;
}
}
}
return false;
}
Widget eventActivityWidget(BuildContext context) {
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) {
@ -741,4 +718,15 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
});
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
}
bool checkIfPrivilegedForChat() {
for (PrivilegeListModel element in AppState().privilegeListModel!) {
if (element.serviceName?.toLowerCase() == "chat") {
if (element.previlege != null) {
return element.previlege!;
}
}
}
return false;
}
}

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

@ -39,7 +39,7 @@ class _OffersAndDiscountsHomeState extends State<OffersAndDiscountsHome> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true),
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

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(),
],
],
);
}
}

@ -1,22 +1,27 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/colors.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';
AppBar AppBarWidget(BuildContext context,
{required String title,
bool showHomeButton = true,
bool showWorkListSettingButton = false,
bool showMemberButton = false,
List<Widget>? actions,
void Function()? onHomeTapped,
void Function()? onBackTapped}) {
AppBar AppBarWidget(
BuildContext context, {
required String title,
bool showHomeButton = true,
bool showLogo = false,
String? logoPath,
bool showWorkListSettingButton = false,
bool showMemberButton = false,
List<Widget>? actions,
void Function()? onHomeTapped,
void Function()? onBackTapped,
}) {
return AppBar(
leadingWidth: 0,
automaticallyImplyLeading: false,
surfaceTintColor: Colors.transparent,
title: Row(
children: [
GestureDetector(
@ -26,8 +31,10 @@ AppBar AppBarWidget(BuildContext context,
}, context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
if (showLogo) 4.width,
if (showLogo) SvgPicture.asset(logoPath!),
4.width,
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
if (!showLogo)title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
],
),
centerTitle: false,
@ -55,7 +62,7 @@ AppBar AppBarWidget(BuildContext context,
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
...actions ?? []
...actions ?? [],
],
);
}

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

@ -16,11 +16,12 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
#version: 3.3.01+300040
version: 4.5.3+4000035
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
@ -36,102 +37,118 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
path_provider: ^2.0.8
# path_provider: ^2.0.8
path_provider: ^2.1.5
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
fluttertoast: ^8.0.8
syncfusion_flutter_calendar: ^19.4.48
local_auth: ^2.3.0
fluttertoast: ^8.2.12
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
# shared_preferences: ^2.0.12
shared_preferences: ^2.5.3
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
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
# open_file: ^3.2.1
open_filex: ^4.4.0
wifi_iot: ^0.3.19+1
platform_device_id_plus: ^1.0.7
device_info_plus: ^11.5.0
image_picker: ^1.1.2
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+2
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
url_launcher: ^6.3.2
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
lottie: ^3.3.1
# Marathon Card Swipe
appinio_swiper: ^1.1.1
expandable: ^5.0.1
safe_device: ^1.1.9
# networkImage
cached_network_image: ^3.2.2
# cached_network_image: ^3.2.2
cached_network_image: ^3.4.1
#Chat
signalr_netcore: ^1.3.3
logging: ^1.0.1
swipe_to: ^1.0.2
flutter_webrtc: ^0.9.17
camera: ^0.10.3
flutter_local_notifications: ^10.0.0
flutter_webrtc: ^0.12.11
camera: ^0.11.2
# camera: ^0.10.3
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
flutter_des: ^2.1.0
video_player: 2.7.0
video_player: ^2.10.0
just_audio: ^0.9.30
# safe_device: ^1.1.2
flutter_layout_grid: ^2.0.1
#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:
@ -228,4 +245,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