Compare commits

..

No commits in common. '0b08606813201dc0152331159d6964b8f7f11a32' and 'c7e44965d6fb68f57cd1afaa042f2d5bd67f68c5' have entirely different histories.

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

@ -1,57 +0,0 @@
{
"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"
}
}
]
}

@ -4,7 +4,7 @@ plugins {
id "com.google.gms.google-services"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.firebase.crashlytics"
id "com.huawei.agconnect"
}
@ -19,7 +19,6 @@ if (keystorePropertiesFile.exists()) {
android {
namespace 'hmg.cloudSolutions.mohem'
compileSdk 36
ndkVersion '28.2.13676358'
kotlinOptions {
@ -34,7 +33,6 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "hmg.cloudSolutions.mohem"
minSdkVersion 30
targetSdk 35
targetSdk = flutter.targetSdkVersion
versionCode flutter.versionCode
versionName flutter.versionName
@ -45,10 +43,6 @@ android {
coreLibraryDesugaringEnabled true
}
buildFeatures{
buildConfig true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
@ -77,8 +71,5 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20"
implementation 'androidx.multidex:multidex:2.0.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation 'com.huawei.hms:push:6.11.0.300'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
}

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

@ -1,8 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
package="hmg.cloudSolutions.mohem">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.NFC" />

@ -1,4 +1,4 @@
package hmg.cloudSolutions.mohem
package com.mohem_flutter_app
//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,23 +1,49 @@
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
//buildscript {
// ext.kotlin_version = '1.9.10'
// repositories {
// google()
// mavenCentral()
// maven { url 'https://developer.huawei.com/repo/' }
// }
//
// dependencies {
// classpath 'com.android.tools.build:gradle:7.1.3'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath 'com.google.gms:google-services:4.3.8'
// classpath 'com.huawei.agconnect:agcp:1.8.0.300'
// classpath "com.android.tools:r8:8.2.33"
// }
//}
//
//allprojects {
// repositories {
// google()
// mavenCentral()
// maven { url 'https://developer.huawei.com/repo/' }
// }
//}
//
//rootProject.buildDir = '../build'
//subprojects {
// project.buildDir = "${rootProject.buildDir}/${project.name}"
// project.evaluationDependsOn(':app')
//}
//
//tasks.register("clean", Delete) {
// delete rootProject.buildDir
//}
dependencies {
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'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
maven {
url 'https://developer.huawei.com/repo/'
}
maven {
url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local"
}
}
// Exclude old BouncyCastle globally to avoid duplicate classes

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

@ -15,19 +15,22 @@ pluginManagement {
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")
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://developer.huawei.com/repo/' }
maven {
url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local"
}
}
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.11.0' apply false
@ -35,22 +38,7 @@ plugins {
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"

@ -1,17 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 4.8 KiB

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

@ -613,11 +613,5 @@
"bonusQty": "Bonus Qty.",
"balQty": "Bal. Qty.",
"start":"Start",
"about":"About",
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya" : "View All Offers"
"about":"About"
}

@ -144,7 +144,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
C4CFBC4C5CAC00182015ACD5 /* [CP] Embed Pods Frameworks */,
EF29CE25BB57F5AA48CE1136 /* [CP] Copy Pods Resources */,
6C6E76E4FB19FAF11C24005D /* [CP] Copy Pods Resources */,
);
buildRules = (
);

@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MoheM</string>
<string>MOHEMM</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

@ -86,7 +86,6 @@ class ApiClient {
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData);
try {
if (!kReleaseMode) {
logger.i("Url: " + url);
logger.i("res: " + response.body);
}
@ -94,12 +93,6 @@ class ApiClient {
if (jsonData["IsAuthenticated"] != null) {
AppState().setIsAuthenticated = jsonData["IsAuthenticated"];
}
// if(url.contains("GetOfferDiscountsConfigData")) {
// jsonData["ErrorMessage"] = "Service Not Available";
// jsonData["ErrorEndUserMessage"] = "Service Not Available";
// }
if (jsonData["ErrorMessage"] == null) {
return factoryConstructor(jsonData);
} else {

@ -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,10 +1,8 @@
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';
@ -19,7 +17,6 @@ import 'package:mohem_flutter_app/models/itg/itg_main_response.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/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';
@ -257,17 +254,10 @@ 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": deviceId, //uuid.v4(), //Mobile Id
"UID": await PlatformDeviceId.getDeviceId, //uuid.v4(), //Mobile Id
// "UID": uuid.v4(), //Mobile Id
"Latitude": lat,
"Longitude": long,

@ -19,26 +19,13 @@ class EITApiClient {
factory EITApiClient() => _instance;
Future<dynamic> getEITTransactions(String functionName, {bool isCompleteList = false}) async {
Future<List<CollectionTransaction>?> getEITTransactions(String functionName) async {
String url = "${ApiConsts.erpRest}GET_EIT_TRANSACTIONS";
Map<String, dynamic> postParams = {'P_FUNCTION_NAME': functionName, "P_MENU_TYPE": "E", "P_PAGE_LIMIT": 50, "P_PAGE_NUM": 1};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
if (isCompleteList) {
List<List<CollectionTransaction>> responseData = [];
json['GetEITTransactionList'].forEach((element) {
var transactionList = GetEitTransactionsModel.fromJson(element).collectionTransaction;
if (transactionList != null) responseData.add(transactionList);
});
return responseData;
} else {
List<CollectionTransaction>? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction;
return responseData;
}
},
url,
postParams,
);
return await ApiClient().postJsonForObject((json) {
List<CollectionTransaction>? responseData = GetEitTransactionsModel.fromJson(json['GetEITTransactionList'][0]).collectionTransaction;
return responseData;
}, url, postParams);
}
}

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

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

@ -6,16 +6,16 @@ class ApiConsts {
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
//
// static String baseUrl = "https://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://mohemm.hmg.com";
// static String baseUrl = "https://mohemm.hmg.com";
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server
@ -68,6 +68,8 @@ class ApiConsts {
static String marathonGetMarathonersCount = marathonBaseUrl + "Participant/GetRemainingParticipants";
static String marathonGetTutorial = marathonBaseUrl + "tutorial/GetTutorialNotification";
//DummyCards for the UI
static int tabletMinLength = 500;

@ -38,12 +38,12 @@ class DateUtil {
return DateTime.now();
}
static DateTime convertSimpleStringDateToDate(String date, {bool isITG = false}) {
static DateTime convertSimpleStringDateToDate(String date) {
// print(date.toUpperCase());
return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2], isITG: isITG);
return getDateTimeFromString(date.split(" ")[0], date.toUpperCase().split(" ")[1] + " " + date.toUpperCase().split(" ")[2]);
}
static DateTime getDateTimeFromString(String date, String time, {bool isITG = false}) {
static DateTime getDateTimeFromString(String date, String time) {
var hours = num.parse(time.split(":")[0]);
var mins = time.split(":")[1];
var secs = time.split(":")[2].split(" ")[0];
@ -60,7 +60,7 @@ class DateUtil {
}
}
date = date + " $hours:$mins:$secs";
DateTime returnDate = isITG ? DateFormat("dd/MM/yyyy HH:mm:ss", "en_US").parse(date) : DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date);
DateTime returnDate = DateFormat("MM/dd/yyyy HH:mm:ss", "en_US").parse(date);
return returnDate;
}

@ -34,7 +34,7 @@ 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>();
AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
bool? granted = await androidImplementation?.requestNotificationsPermission();
if (granted == false) {
if (kDebugMode) {

@ -67,7 +67,6 @@ 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) {
@ -203,13 +202,8 @@ class OtpDialog {
),
errorBorder: 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: 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, constant_identifier_names
// ignore_for_file: prefer_single_quotes, avoid_renaming_method_parameters
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,7 +116,6 @@ class CodegenLoader extends AssetLoader{
"reject": "يرفض",
"approve": "يوافق",
"cancel": "إلغاء",
"generate": "يولد",
"requestedItems": "العناصر المطلوبة",
"request": "طلب",
"myRequest": "طلبي",
@ -561,9 +560,10 @@ class CodegenLoader extends AssetLoader{
"missingDocuments": "مستندات مفقودة",
"uploadedDocuments": "المستندات التي تم تحميلها",
"addAtLeastOneAttachment": "الرجاء إضافة مرفق واحد على الأقل.",
"pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"open": "يفتح",
"youCannotJoinTheMarathon": "لا يمكنك الانضمام إلى الماراثون لأنك تجاوزت الحد الزمني",
"pleaseClickButtonToJoinMarathon": "الرجاء الضغط على الزر أدناه للانضمام إلى الماراثون",
"generate": "يولد",
"paymentRequest": "طلب الدفع",
"paymentDetails": "تفاصيل الدفع",
"requestNo": "رقم الطلب",
@ -627,15 +627,10 @@ class CodegenLoader extends AssetLoader{
"members": "الأعضاء",
"searchByUserName": "البحث بواسطة اسم المستخدم",
"shareScreen": "مشاركة الشاشة",
"start": "يبدأ",
"about": "عن",
"explore": "يستكشف",
"mazaya": "مازيا",
"benefits": "فوائد",
"mazayaDesc": "اكتشف الخصومات والعروض الخاصة المتاحة للموظفين",
"viewallofferMazaya": "أعرض كل المزايا"
"start":"يبدأ",
"about":"عن"
};
static const Map<String,dynamic> _en_US = {
static const Map<String,dynamic> en_US = {
"mohemm": "Mohemm",
"english": "English",
"arabic": "عربي",
@ -730,7 +725,6 @@ static const Map<String,dynamic> _en_US = {
"whatsapp": "Whatsapp",
"reject": "Reject",
"approve": "Approve",
"generate": "Generate",
"cancel": "Cancel",
"requestedItems": "Requested Items",
"request": "Request",
@ -1203,6 +1197,7 @@ 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",
@ -1248,13 +1243,8 @@ static const Map<String,dynamic> _en_US = {
"qtyReceived": "Qty. Received",
"bonusQty": "Bonus Qty.",
"balQty": "Bal. Qty.",
"start": "Start",
"about": "About",
"explore": "Explore",
"mazaya": "MAZAYA",
"benefits": "Benefits",
"mazayaDesc": "Discover special Discounts and offers available to Employees",
"viewallofferMazaya": "View All Offers"
"start":"Start",
"about":"About"
};
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,7 +1,5 @@
// 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';
@ -103,7 +101,6 @@ 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';
@ -533,9 +530,10 @@ abstract class LocaleKeys {
static const missingDocuments = 'missingDocuments';
static const uploadedDocuments = 'uploadedDocuments';
static const addAtLeastOneAttachment = 'addAtLeastOneAttachment';
static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon';
static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon';
static const open = 'open';
static const youCannotJoinTheMarathon = 'youCannotJoinTheMarathon';
static const pleaseClickButtonToJoinMarathon = 'pleaseClickButtonToJoinMarathon';
static const generate = 'generate';
static const paymentRequest = 'paymentRequest';
static const paymentDetails = 'paymentDetails';
static const requestNo = 'requestNo';
@ -600,11 +598,5 @@ abstract class LocaleKeys {
static const searchByUserName = 'searchByUserName';
static const shareScreen = 'shareScreen';
static const start = 'start';
static const about = 'about';
static const explore = 'explore';
static const mazaya = 'mazaya';
static const benefits = 'benefits';
static const mazayaDesc = 'mazayaDesc';
static const viewallofferMazaya = 'viewallofferMazaya';
static const about ='about';
}

@ -5,21 +5,21 @@ UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel.
String userAutoLoginModelToJson(UserAutoLoginModel data) => json.encode(data.toJson());
class UserAutoLoginModel {
UserAutoLoginModel({this.response, this.errorResponses, this.StatusCode});
UserAutoLoginModel({
this.response,
this.errorResponses,
});
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,7 +1,6 @@
class Advertisement {
int? advertisementId;
String? advertisementTitle;
String? advertisementTitleAr;
int? durationInSeconds;
bool? showDelete;
dynamic acknowledgment;
@ -17,7 +16,6 @@ class Advertisement {
Advertisement({
this.advertisementId,
this.advertisementTitle,
this.advertisementTitleAr,
this.durationInSeconds,
this.showDelete,
this.acknowledgment,
@ -36,7 +34,6 @@ class Advertisement {
Advertisement.fromJson(Map<String, dynamic> json) {
advertisementId = json['advertisementId'];
advertisementTitle = json['advertisementTitle'];
advertisementTitleAr = json['advertisementTitleAr'];
durationInSeconds = json['durationInSeconds'];
showDelete = json['showDelete'];
acknowledgment = json['acknowledgment'];
@ -66,7 +63,6 @@ class Advertisement {
Map<String, dynamic> data = Map<String, dynamic>();
data['advertisementId'] = this.advertisementId;
data['advertisementTitle'] = this.advertisementTitle;
data['advertisementTitleAr'] = this.advertisementTitleAr;
data['durationInSeconds'] = this.durationInSeconds;
data['showDelete'] = this.showDelete;
data['acknowledgment'] = this.acknowledgment;

@ -93,12 +93,6 @@ 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 {
@ -405,8 +399,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;
}
}
@ -482,8 +476,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;
}
}
@ -1659,7 +1653,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
void sRecoding() async {
isVoiceMsg = true;
recorderController.reset();
await recorderController.record(path: path);
await recorderController.record(path);
_recodeDuration = 0;
_startTimer();
isRecoding = !isRecoding;
@ -1691,7 +1685,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
File file = File(path!);
file.readAsBytesSync();
path = file.path;
await playerController.preparePlayer(path:file.path, volume: 1.0);
await playerController.preparePlayer(file.path, 1.0);
_timer?.cancel();
notifyListeners();
}

@ -19,7 +19,6 @@ import 'package:mohem_flutter_app/models/dashboard/list_menu.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/menus.dart';
import 'package:mohem_flutter_app/models/dashboard/mohemm_itg_pending_task_responseitem.dart';
import 'package:mohem_flutter_app/models/eit/get_eit_transaction_model.dart';
import 'package:mohem_flutter_app/models/generic_response_model.dart';
import 'package:mohem_flutter_app/models/itg/itg_response_model.dart';
import 'package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart';
@ -61,7 +60,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
EventActivityList? eventActivity;
TicketBookingResult? ticketBookingResponse;
List<List<CollectionTransaction>>? ticketHistoryTransactionList = [];
//Offers And Discounts
bool isOffersLoading = true;
@ -302,7 +300,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
logger.wtf(ex);
isEventLoadingLoading = false;
notifyListeners();
// Utils.handleException(ex, null, null);
Utils.handleException(ex, null, null);
}
}

@ -18,7 +18,6 @@ import 'package:mohem_flutter_app/widgets/Updater.dart';
class EITProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<CollectionTransaction>? eitTransactionList;
late bool isEitLoaded = false;
void getEITList(String functionName) async {
try {
eitTransactionList = await EITApiClient().getEITTransactions(functionName);

@ -16,36 +16,84 @@ class AppTheme {
},
),
hintColor: Colors.grey[400],
colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor).copyWith(surfaceTint : Colors.transparent),
colorScheme: ColorScheme.fromSwatch(
accentColor: MyColors.backgroundColor,
errorColor: const Color.fromRGBO(235, 80, 60, 1.0),
),
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,
// toggleableActiveColor: secondaryColor,
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;
}),
),
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(
// bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6),
// headline1: TextStyle(color: Colors.white, letterSpacing: 0.6),
// headline2: TextStyle(color: Colors.white, letterSpacing: 0.6),
bodyMedium: TextStyle(color: Colors.black, letterSpacing: 0.6),
headlineSmall: TextStyle(color: Colors.white, letterSpacing: 0.6),
headlineMedium: TextStyle(color: Colors.white, letterSpacing: 0.6),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme(
appBarTheme: AppBarTheme(
systemOverlayStyle: const SystemUiOverlayStyle(
statusBarBrightness: Brightness.light,
),
color: const Color(0xff515A5D),
systemOverlayStyle: const SystemUiOverlayStyle(statusBarBrightness: Brightness.light),
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],

@ -301,7 +301,6 @@ 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';
@ -311,9 +310,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[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].dAYTYPE == 'OFF';
bool isDayIsPresent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = getDayHoursTypeDetailsList[index].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[index].aBSENTFLAG == 'Y';
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';
if (isDayIsOff) {
return Container(

@ -32,11 +32,8 @@ class _ChatHomeState extends State<ChatHome> {
@override
void initState() {
super.initState();
if (chatHubConnection.state == HubConnectionState.Connected) {
data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents();
}
data = Provider.of<ChatProviderModel>(context, listen: false);
data.registerEvents();
}
@override
@ -50,6 +47,7 @@ class _ChatHomeState extends State<ChatHome> {
data.getUserAutoLoginToken().whenComplete(() async {
await data.buildHubConnection();
data.getUserRecentChats();
});
return;
}
@ -59,7 +57,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,13 +214,8 @@ class _ChatHomeScreenState extends State<ChatHomeScreen> {
},
),
floatingActionButton: FloatingActionButton(
// <<<<<<< HEAD
// elevation: 0,
// backgroundColor : Colors.transparent,
// =======
backgroundColor: Colors.transparent,
elevation: 0,
child: Container(
width: 60,
height: 60,

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

@ -60,10 +60,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void initState() {
WidgetsBinding.instance.addObserver(this);
super.initState();
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false);
marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
cProvider = Provider.of<ChatProviderModel>(context, listen: false);
if (checkIfPrivilegedForChat()) {
_bHubCon();
}
@ -117,7 +117,6 @@ 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();
@ -153,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) {
@ -244,457 +243,440 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
@override
Widget build(BuildContext context) {
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,
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(
return Scaffold(
key: _scaffoldState,
body: Column(
children: [
Row(
children: [
Builder(
builder: (BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
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],
),
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,
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],
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
],
),
],
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
),
child: Stack(
alignment: Alignment.center,
children: [
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min,
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,
9.height,
Directionality(
textDirection: ui.TextDirection.ltr,
child: CountdownTimer(
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20)),
child: LinearProgressIndicator(
value: model.progress,
minHeight: 8,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor: const Color(0xff196D73),
),
),
4.height,
],
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: const Color(0xff259EA4),
borderRadius: BorderRadius.only(
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));
}),
],
),
],
),
],
),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
.animatedSwither();
},
),
),
),
9.width,
Expanded(child: MenusWidget()),
],
),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
),
child: Padding(
padding: const EdgeInsets.all(3.0), // This creates the border width
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Expanded(
flex: 2,
child: RichText(
text:
AppState().isArabic(context)
? TextSpan(
).paddingOnly(top: 12, right: 15, left: 12),
),
Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
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)),
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
color: Colors.white,
isBold: true,
),
4.height,
],
).paddingOnly(left: 12, right: 12),
),
Container(
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: 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),
),
),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
).onPress(() {
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
}),
],
),
],
),
),
const Expanded(flex: 1, child: SizedBox()),
],
),
const SizedBox(height: 8),
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
],
),
),
Expanded(
flex: 2,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
const SizedBox(height: 28),
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
),
),
],
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
],
),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
}))
.animatedSwither();
},
),
),
).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);
// }),
),
9.width,
Expanded(child: MenusWidget()),
],
),
),
],
),
),
),
),
],
),
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),
],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context),
Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.workListCounter == 0) {
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
if (!model.isOffersLoading && model.getOffersList.isEmpty) {
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),
),
return 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)),
child: LocaleKeys.newString.tr().toText10(isBold: true),
),
],
),
],
),
),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
}),
],
).paddingOnly(left: 21, right: 21),
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
return SizedBox(
height: 103 + 33,
child: ListView.separated(
shrinkWrap: true,
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext cxt, int index) {
return model.isOffersLoading
? const OffersShimmerWidget()
: InkWell(
onTap: () {
navigateToDetails(data.getOffersList[index]);
},
child: SizedBox(
width: 73,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73,
height: 73,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(100)),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
transitionOnUserGestures: true,
child: Image.network(data.getOffersList[index].logo ?? "", fit: BoxFit.contain),
),
),
),
4.height,
Expanded(
child:
AppState().isArabic(context)
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 9,
),
);
},
),
],
);
},
),
Container(
width: double.infinity,
padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ServicesWidget(),
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 8, top: 8),
// context.watch<MarathonProvider>().isTutorialLoading
// ? const MarathonBannerShimmer().paddingAll(20)
// : Container(
// padding: EdgeInsets.only(bottom: 12, top: 12),
// margin: EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 8),
// width: double.infinity,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: MyColors.backgroundBlackColor,
// borderRadius: BorderRadius.circular(20),
// border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// "Tutorial:",
// style: TextStyle(
// fontSize: 11,
// fontStyle: FontStyle.italic,
// fontWeight: FontWeight.w600,
// color: MyColors.white.withOpacity(0.83),
// letterSpacing: -0.4,
// ),
// ),
// Text(
// context.read<MarathonProvider>().tutorial?.tutorialName ?? "",
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontStyle: FontStyle.italic,
// fontSize: 19,
// fontWeight: FontWeight.bold,
// color: MyColors.white,
// height: 32 / 22,
// ),
// ),
// ],
// ),
// ).onPress(() {
// checkERMChannel();
// // Navigator.pushNamed(context, AppRoutes.marathonTutorialScreen);
// }),
],
),
),
],
),
label: LocaleKeys.workList.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
label: LocaleKeys.itemsForSale.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: 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.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),
),
);
},
),
],
),
],
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);
}
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);
}
},
),
}
},
),
),
);

@ -11,10 +11,8 @@ import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/main.dart';
import 'package:mohem_flutter_app/models/itg/advertisement.dart' as ads;
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/my_video_progress_indicator.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:video_player/video_player.dart';
class ITGAdsScreen extends StatefulWidget {
@ -33,8 +31,6 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
bool isAudio = false;
String ext = '';
bool isTextURL = false;
// late File imageFile;
late String imageUrl;
ads.Advertisement? advertisementData;
@ -49,27 +45,23 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
late CountdownTimerController timerController;
void checkFileType() {
if (advertisementData!.viewAttachFileColl!.first.contentType!.toLowerCase() == "text") {
isTextURL = true;
} else {
String? rFile = advertisementData!.viewAttachFileColl!.first.base64String;
try {
rFile = advertisementData!.viewAttachFileColl!.where((element) => element.languageId == AppState().getLanguageID(context)).toList().first.base64String;
} catch (ex) {}
String? rFile = advertisementData!.viewAttachFileColl!.first.base64String;
try {
rFile = advertisementData!.viewAttachFileColl!.where((element) => element.languageId == AppState().getLanguageID(context)).toList().first.base64String;
} catch (ex) {}
String? rFileExt = advertisementData!.viewAttachFileColl!.first.fileName;
ext = "." + rFileExt!.split(".").last.toLowerCase();
if (ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".gif") {
// await processImage();
imageUrl = rFile!;
isImage = true;
} else {
if (ext == ".aac") {
isAudio = true;
}
isVideo = true;
_futureController = createVideoPlayer(rFile!);
String? rFileExt = advertisementData!.viewAttachFileColl!.first.fileName;
ext = "." + rFileExt!.split(".").last.toLowerCase();
if (ext == ".png" || ext == ".jpg" || ext == ".jpeg" || ext == ".gif") {
// await processImage();
imageUrl = rFile!;
isImage = true;
} else {
if (ext == ".aac") {
isAudio = true;
}
isVideo = true;
_futureController = createVideoPlayer(rFile!);
}
// advertisementData?.actionButtonsColl!.forEach((element) {
@ -140,17 +132,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
timerController = CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + 1000 * videoDuration, onEnd: onTimerEnd);
}
return Scaffold(
backgroundColor: isTextURL ? Colors.white : Colors.black,
appBar: isTextURL
? AppBar(
centerTitle: true,
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
title: (AppState().isArabic(context) ? advertisementData!.advertisementTitleAr! : advertisementData!.advertisementTitleAr!).toText24(color: MyColors.darkTextColor, isBold: true),
//advertisementData!.viewAttachFileColl!.first.base64String!.toText24(color: MyColors.darkTextColor, isBold: true),
)
: null,
backgroundColor: Colors.black,
body: Stack(
children: [
if (isVideo)
@ -364,45 +346,6 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
],
),
),
if (isTextURL)
SingleChildScrollView(
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
(AppState().isArabic(context) ? advertisementData!.viewAttachFileColl![0].base64String! : advertisementData!.viewAttachFileColl![1].base64String!)
.toText16(color: MyColors.darkTextColor),
24.height,
ListView.separated(
itemCount: advertisementData!.actionButtonsColl?.length ?? 0,
separatorBuilder: (cxt, index) => 16.height,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
itemBuilder: (cxt, index) => DefaultButton(
AppState().isArabic(context) ? advertisementData!.actionButtonsColl![index].btnTextAr : advertisementData!.actionButtonsColl![index].btnTextEn,
() async {
if (advertisementData!.actionButtonsColl![index].actionValue.toLowerCase() == "skip") {
Navigator.pop(context);
} else {
Uri uri = Uri.parse(advertisementData!.actionButtonsColl![index].iconOrImage);
// if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication).catchError((err) {
// print(err);
Utils.showToast('Could not launch');
});
Navigator.pop(context);
// } else {
// Utils.showToast('Could not launch');
// }
}
},
),
),
],
),
),
],
),
);

@ -5,7 +5,6 @@ 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/api/eit_api_client.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';
@ -264,9 +263,6 @@ class ServicesWidget extends StatelessWidget {
if (ssoToken != null) {
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
await pro.fetchTicketAccuralBalance(context, DateTime.now());
pro.ticketHistoryTransactionList = await EITApiClient().getEITTransactions("HMG_TICKET_ITENARY_HR_EIT_SS", isCompleteList: true);
Utils.hideLoading(context);
// Here Need Work
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => TicketDetailedScreen(url: url, jwtToken: ssoToken.data!.accessToken)));

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.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:local_auth_darwin/local_auth_darwin.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';
@ -66,17 +66,16 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return Scaffold(
appBar: AppBar(
surfaceTintColor: Colors.transparent,
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: const BusinessCardDialog());
})
: Container(),
title:
(mobileLoginInfoListModel?.businessCardPrivilege ?? false)
? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: const BusinessCardDialog());
})
: Container(),
actions: [
Center(
child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {
showMDialog(context, child: EmployeeDigitialIdDialog());
}),
@ -112,7 +111,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [LocaleKeys.lastLoginDetails.tr().toText16(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn ?? DateTime.now().toString()), false).toText12()],
children: [LocaleKeys.lastLoginDetails.tr().toText16(), DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12()],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -207,25 +206,18 @@ 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', options: const AuthenticationOptions(
useErrorDialogs: true, stickyAuth: true, biometricOnly: true,
),
authMessages: [
iosStrings,
const AndroidAuthMessages(),
],
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);
@ -236,60 +228,48 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
// <<<<<<< 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
bool isDisable =
(_flag == 3 && !checkBiometricIsAvailable(BiometricType.face) ||
_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint) && _flag == 4 && !checkBiometricIsAvailable(BiometricType.strong));
return InkWell(
onTap: isDisable
? null
: () async {
if (_flag == 0) {
setState(() {
// isMoreOption = true;
});
} else {
if (_flag == 3 || _flag == 4) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
if (!authenticateWithFaceAndTouchID) {
return;
} else {
if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) {
// bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
// if (!authenticateWithFaceAndTouchID) {
// return;
// } else {
// performApiCall(_title, _icon, _flag, isDirectLogin: true);
// }
performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true);
onTap:
isDisable
? null
: () async {
if (_flag == 0) {
setState(() {
// isMoreOption = true;
});
} else {
if (_flag == 3 || _flag == 4) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
if (!authenticateWithFaceAndTouchID) {
return;
} else {
isNeedVerifyWithFaceIDAndBiometrics = true;
selectedFlag = _flag;
setState(() {
return;
});
if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) {
// bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
// if (!authenticateWithFaceAndTouchID) {
// return;
// } else {
// performApiCall(_title, _icon, _flag, isDirectLogin: true);
// }
performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true);
} else {
isNeedVerifyWithFaceIDAndBiometrics = true;
selectedFlag = _flag;
setState(() {
return;
});
}
}
} else {
if (isNeedVerifyWithFaceIDAndBiometrics)
performApiCall(_title, _icon, selectedFlag, _flag);
else
performApiCall(_title, _icon, _flag, _flag);
}
} else {
if (isNeedVerifyWithFaceIDAndBiometrics)
performApiCall(_title, _icon, selectedFlag, _flag);
else
performApiCall(_title, _icon, _flag, _flag);
}
}
},
},
child: Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
@ -413,15 +393,15 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}
}
//
// formatDate(date) {
// return date;
// return DateFormat('MMM dd, yyy, kk:mm').format(date);
// }
//
// showLoader(bool isTrue) {
// setState(() {
// // isLoading = isTrue;
// });
// }
//
// formatDate(date) {
// return date;
// return DateFormat('MMM dd, yyy, kk:mm').format(date);
// }
//
// showLoader(bool isTrue) {
// setState(() {
// // isLoading = isTrue;
// });
// }
}

@ -4,9 +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/local_auth.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';
import 'package:mohem_flutter_app/classes/colors.dart';
@ -518,11 +518,14 @@ 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',
options: const AuthenticationOptions(useErrorDialogs: true, stickyAuth: true, biometricOnly: true,), authMessages: [
iosStrings,
const AndroidAuthMessages(),
],);
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);
@ -532,17 +535,25 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
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.strong));
// 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))));
return InkWell(
onTap: isDisable
? null

@ -61,7 +61,13 @@ 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,
@ -81,20 +87,19 @@ 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),
@ -129,7 +134,11 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
}
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() {
@ -148,7 +157,16 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
Hero(
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),
@ -162,7 +180,10 @@ 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, showLogo: true, logoPath: "assets/icons/mazaya_brand.svg"),
appBar: AppBarWidget(context, title: LocaleKeys.offerAndDiscounts.tr(), showHomeButton: true),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
@ -14,7 +12,6 @@ import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/balances_dashboard_widget.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/item_detail_view_widget.dart';
import 'package:mohem_flutter_app/widgets/sso_webview_widget.dart';
import 'package:provider/provider.dart';
@ -57,26 +54,27 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
backgroundColor: Colors.white,
appBar: AppBarWidget(context, title: "Ticket Details"),
body: Column(
children: <Widget>[
children: [
ListView(
padding: const EdgeInsets.all(21),
physics: const BouncingScrollPhysics(),
children: <Widget>[
if (dashboardProviderModel == null && dashboardProviderModel?.accrualTicketBalanceList == null) ...<Widget>[Utils.getNoDataWidget(context).paddingOnly(top: 50)] else ...<Widget>[
// const BalancesDashboardWidget("Current Ticket Balance", false, showLoading: false), 12.height,
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
boxShadow: <BoxShadow>[BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))],
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.2), spreadRadius: 2, blurRadius: 5, offset: const Offset(0, 3))],
),
child: Column(
children: <Widget>[
children: [
Row(
children: <Widget>[
children: [
"Current Ticket Balance".toText20().expanded,
Row(
children: <Widget>[
children: [
const Icon(Icons.calendar_month_rounded, color: MyColors.darkIconColor, size: 16),
5.width,
DateUtil.formatDateToDate(accrualDateTime, AppState().isArabic(context)).toText13(isUnderLine: true),
@ -111,67 +109,6 @@ class _TicketDetailedScreenState extends State<TicketDetailedScreen> {
],
),
),
const SizedBox(height: 21),
dashboardProviderModel == null && dashboardProviderModel!.ticketHistoryTransactionList == null
? const SizedBox()
: ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: <Widget>[
"Tickets History".toText20().expanded,
12.height,
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext cxt, int cardIndex) {
var transactionDetails = dashboardProviderModel!.ticketHistoryTransactionList![cardIndex];
const allowedSegmentNames = <String>{
"TICKETS_ROUTE",
"TRAVELER_NAME",
"TICKETS_EFFECTIVE_DATE",
"TICKET_ARRIVAL",
"TICKET_AMOUNT",
"TICKET_COMP_SHARE",
"TICKET_EMP_SHARE",
};
var uniqueDetails =
transactionDetails
.where((item) => item.dISPLAYFLAG != 'N' && item.sEGMENTPROMPT != null && item.sEGMENTPROMPT!.isNotEmpty && allowedSegmentNames.contains(item.sEGMENTNAME))
.toList();
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: (uniqueDetails.length / 2).ceil(),
itemBuilder: (context, rowIndex) {
int firstIndex = rowIndex * 2;
int? secondIndex = (firstIndex + 1 < uniqueDetails.length) ? firstIndex + 1 : null;
bool isLastRow = (rowIndex == (uniqueDetails.length / 2).ceil() - 1);
var item1 = uniqueDetails[firstIndex];
var child1 = ItemDetailViewCol(item1.sEGMENTPROMPT!, item1.vARCHAR2VALUE ?? item1.nUMBERVALUE?.toString() ?? "");
Widget child2;
if (secondIndex != null) {
var item2 = uniqueDetails[secondIndex];
child2 = ItemDetailViewCol(item2.sEGMENTPROMPT!, item2.vARCHAR2VALUE ?? item2.nUMBERVALUE?.toString() ?? "");
} else {
child2 = const SizedBox(); // Empty widget if there is no second item
}
return ItemDetailGrid(child1, child2, isItLast: isLastRow);
},
),
],
).objectContainerView();
},
separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: dashboardProviderModel!.ticketHistoryTransactionList!.length,
),
],
),
],
],
).expanded,

@ -211,7 +211,7 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
interval: 1,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
meta: meta,
child: Text(reversedList[int.parse(meta.formattedValue)].cREATIONDATE!, style: TextStyle(fontSize: 10)),
);
})),
@ -222,7 +222,7 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
interval: 1,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
meta: meta,
child: Text(meta.formattedValue, style: TextStyle(fontSize: 10)),
);
})),
@ -233,7 +233,7 @@ class _ItemHistoryScreenState extends State<ItemHistoryScreen> {
reservedSize: 15,
getTitlesWidget: (double value, TitleMeta meta) {
return SideTitleWidget(
axisSide: meta.axisSide,
meta: meta,
child: Text("", style: TextStyle(fontSize: 10)),
);
})),

File diff suppressed because one or more lines are too long

@ -2,7 +2,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/date_uitl.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';
@ -29,7 +28,7 @@ class ApprovalLevelfragment extends StatelessWidget {
itemCount: wFHistory.length,
padding: const EdgeInsets.all(21),
itemBuilder: (context, index) {
return showItem(context, wFHistory[index], index);
return showItem(context, wFHistory[index]);
},
separatorBuilder: (BuildContext context, int index) {
return 12.height;
@ -38,7 +37,7 @@ class ApprovalLevelfragment extends StatelessWidget {
);
}
Widget showItem(BuildContext context, WFHistory history, int index) {
Widget showItem(BuildContext context, WFHistory history) {
return Container(
width: double.infinity,
decoration: BoxDecoration(
@ -90,9 +89,7 @@ class ApprovalLevelfragment extends StatelessWidget {
8.width,
if (history.date!.isNotEmpty) history.date!.toText12(color: MyColors.lightTextColor),
],
),
10.height,
getActionDuration(index).toText11(maxLine: 1, color: const Color(0xff1FA269))
)
],
),
)
@ -146,34 +143,8 @@ class ApprovalLevelfragment extends StatelessWidget {
);
}
String getActionDuration(int index) {
if (wFHistory[index].action!.toLowerCase() == "submit" || wFHistory[index].action!.toLowerCase() == "submitted") {
return "";
// DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!);
// Duration duration = DateTime.now().difference(dateTimeFrom);
// return "Action duration: " + DateUtil.formatDuration(duration);
} else if (wFHistory[index].employeeID == AppState().memberInformationList?.eMPLOYEENUMBER) {
if (wFHistory[index + 1].date!.isEmpty || wFHistory[index + 1].date! == "") {
return "";
} else {
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!, isITG: true);
Duration duration = DateTime.now().difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
}
} else {
if (wFHistory[index].date!.isEmpty || wFHistory[index].action!.toLowerCase() == "NO ACTION" || wFHistory[index + 1].date! == "") {
return "";
} else {
DateTime dateTimeTo = DateUtil.convertSimpleStringDateToDate(wFHistory[index].date!);
DateTime dateTimeFrom = DateUtil.convertSimpleStringDateToDate(wFHistory[index + 1].date!);
Duration duration = dateTimeTo.difference(dateTimeFrom);
return "Action duration: " + DateUtil.formatDuration(duration);
}
}
}
Color getStatusColor(String code) {
if (code.toLowerCase() == "submit" || code.toLowerCase() == "submitted") {
if (code.toLowerCase() == "submit") {
return MyColors.grey3AColor;
} else if (code.toLowerCase() == "pending") {
return MyColors.yellowColor;
@ -181,7 +152,7 @@ class ApprovalLevelfragment extends StatelessWidget {
return MyColors.redColor;
} else if (code.toLowerCase() == "approved" || code.toLowerCase() == "auto-approve" || code.toLowerCase() == "auto-approved" || code.toLowerCase() == "doable" || code.toLowerCase() == "answer") {
return MyColors.greenColor;
} else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "request information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") {
} else if (code.toLowerCase() == "requested information" || code.toLowerCase() == "assign" || code.toLowerCase() == "reassign") {
return MyColors.orange;
} else {
return MyColors.whiteColor;

File diff suppressed because one or more lines are too long

@ -1,5 +1,4 @@
import 'dart:collection';
import 'dart:convert';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
@ -33,16 +32,8 @@ class DelegateSheet extends StatefulWidget {
VoidCallback callBackFunc;
List<NotificationGetRespondAttributesList> getNotificationRespondAttributes;
DelegateSheet({
super.key,
required this.title,
required this.apiMode,
this.notificationID,
this.actionHistoryList,
this.wFHistory,
required this.callBackFunc,
this.getNotificationRespondAttributes = const <NotificationGetRespondAttributesList>[],
});
DelegateSheet(
{required this.title, required this.apiMode, this.notificationID, this.actionHistoryList, this.wFHistory, required this.callBackFunc, this.getNotificationRespondAttributes = const []});
@override
State<DelegateSheet> createState() => _DelegateSheetState();
@ -55,8 +46,8 @@ class _DelegateSheetState extends State<DelegateSheet> {
String? selectedFavLetter;
String selectedType = "Workflow";
String inputRes = "";
List<String>? favLetters;
List<GetFavoriteReplacements>? favUsersList;
List<GetFavoriteReplacements>? filteredFavUsersList = <GetFavoriteReplacements>[];
List<ReplacementList>? replacementList;
bool isImageLoaded = false;
@ -66,14 +57,14 @@ class _DelegateSheetState extends State<DelegateSheet> {
super.initState();
if (widget.wFHistory != null) {
widget.wFHistory = widget.wFHistory!.reversed.toList();
Set<String?> ids = widget.wFHistory!.map((WFHistory e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((WFHistory x) => ids.remove(x.employeeID));
var ids = widget.wFHistory!.map((e) => e.employeeID).toSet();
widget.wFHistory!.retainWhere((x) => ids.remove(x.employeeID));
}
if (widget.actionHistoryList != null) {
widget.actionHistoryList = widget.actionHistoryList!.reversed.toList();
Set<String?> ids = widget.actionHistoryList!.map((GetActionHistoryList e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((GetActionHistoryList x) => ids.remove(x.uSERNAME));
var ids = widget.actionHistoryList!.map((e) => e.uSERNAME).toSet();
widget.actionHistoryList!.retainWhere((x) => ids.remove(x.uSERNAME));
}
}
@ -82,96 +73,36 @@ class _DelegateSheetState extends State<DelegateSheet> {
super.dispose();
}
Future<void> fetchFavUsers({bool isNeedLoading = true}) async {
favUsersList = <GetFavoriteReplacements>[];
filteredFavUsersList = <GetFavoriteReplacements>[];
Future fetchFavLetters({bool isNeedLoading = true}) async {
favLetters = [];
if (isNeedLoading) Utils.showLoading(context);
try {
List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
favUsersList = favList;
if (favUsersList != null && favUsersList!.isNotEmpty) {
favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase()));
filteredFavUsersList = favUsersList;
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
_fetchAndAttachUserImages();
} else {
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
}
} catch (e) {
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
}
List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
List<String> result = [];
favList!.forEach((element) {
result.add(element.employeeDisplayName![0]);
});
favLetters = LinkedHashSet<String>.from(result).toList();
if (isNeedLoading) Utils.hideLoading(context);
setState(() {
favLetters!.sort((a, b) {
return a.toLowerCase().compareTo(b.toLowerCase());
});
});
return null;
}
Future<void> _fetchAndAttachUserImages() async {
try {
List<GetFavoriteReplacements>? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew("");
if (tempList != null && tempList.isNotEmpty && favUsersList != null) {
for (GetFavoriteReplacements element in favUsersList!) {
for (GetFavoriteReplacements element2 in tempList) {
if (element.userName == element2.userName && element2.employeeImage != null && element2.employeeImage!.isNotEmpty) {
element.employeeImage = element2.employeeImage;
}
}
}
filteredFavUsersList = favUsersList;
setState(() {});
}
} catch (e) {}
Future fetchFavUsersList({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
fetchFavUsersListNew(isNeedLoading: false);
return null;
}
// Future<void> fetchFavUsers({bool isNeedLoading = true}) async {
// favUsersList = <GetFavoriteReplacements>[];
// if (isNeedLoading) Utils.showLoading(context);
//
// try {
// List<GetFavoriteReplacements>? favList = await WorkListApiClient().getFavoriteReplacementWithoutImage();
// favUsersList = favList;
//
// if (favUsersList != null && favUsersList!.isNotEmpty) {
// setState(() {
// favUsersList!.sort((GetFavoriteReplacements a, GetFavoriteReplacements b) => (a.employeeDisplayName ?? '').toLowerCase().compareTo((b.employeeDisplayName ?? '').toLowerCase()));
// });
// if (isNeedLoading) Utils.hideLoading(context);
//
// List<GetFavoriteReplacements>? tempList = await WorkListApiClient().getFavoriteReplacementWithImageNew("");
// if (tempList != null && tempList.isNotEmpty) {
// for (GetFavoriteReplacements element in favUsersList!) {
// for (GetFavoriteReplacements element2 in tempList) {
// if (element.userName == element2.userName) {
// if (element2.employeeImage != null && element2.employeeImage!.isNotEmpty) {
// element.employeeImage = element2.employeeImage;
// }
// }
// }
// }
// setState(() {});
// }
// }
// } catch (e) {
// // if (isNeedLoading) Utils.hideLoading(context);
// }
// }
// Future fetchFavUsersList({bool isNeedLoading = true}) async {
// if (isNeedLoading) Utils.showLoading(context);
// favUsersList = await WorkListApiClient().getFavoriteReplacementWithImage(selectedFavLetter ?? "");
// if (isNeedLoading) Utils.hideLoading(context);
// setState(() {});
// fetchFavUsersListNew(isNeedLoading: false);
// return null;
// }
Future fetchFavUsersListNew({bool isNeedLoading = true}) async {
if (isNeedLoading) Utils.showLoading(context);
filteredFavUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? "");
favUsersList = await WorkListApiClient().getFavoriteReplacementWithImageNew(selectedFavLetter ?? "");
if (isNeedLoading) Utils.hideLoading(context);
setState(() {
isImageLoaded = true;
@ -181,10 +112,18 @@ class _DelegateSheetState extends State<DelegateSheet> {
void fetchChangeFav({required String email, required String employeName, required String image, required String userName, bool isFav = false, bool isNeedToRefresh = false}) async {
Utils.showLoading(context);
GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(email: email, employeName: employeName, image: image, userName: userName, isFav: isFav);
favLetters = null;
selectedFavLetter = null;
GenericResponseModel model = await WorkListApiClient().changeFavoriteReplacements(
email: email,
employeName: employeName,
image: image,
userName: userName,
isFav: isFav,
);
if (isNeedToRefresh) {
await fetchFavUsers(isNeedLoading: false);
// if (favUsersList != null) await fetchFavUsersList(isNeedLoading: false);
await fetchFavLetters(isNeedLoading: false);
if (favLetters != null) await fetchFavUsersList(isNeedLoading: false);
}
Utils.hideLoading(context);
@ -198,58 +137,44 @@ class _DelegateSheetState extends State<DelegateSheet> {
userName: selectedType == "Employee Name" ? inputRes : "",
email: selectedType == "Employee Email" ? inputRes : "",
);
if (isNeedLoading) Utils.hideLoading(context);
setState(() {});
return null;
}
Future<void> searchFavUser() async {
if (favUsersList != null && favUsersList!.isNotEmpty) {
// if (inputRes.length > 0) {
filteredFavUsersList =
favUsersList!.where((GetFavoriteReplacements element) {
String query = inputRes.toLowerCase();
return (element.employeeDisplayName != null && element.employeeDisplayName!.toLowerCase().startsWith(query)) ||
(element.userName != null && element.userName!.toLowerCase().contains(query)) ||
(element.emailAddress != null && element.emailAddress!.toLowerCase().contains(query));
}).toList();
// } else {
// filteredFavUsersList = favUsersList;
// }
} else {
filteredFavUsersList = <GetFavoriteReplacements>[];
}
setState(() {});
}
@override
Widget build(BuildContext context) {
return SizedBox(
return Container(
width: double.infinity,
height: MediaQuery.of(context).size.height - 80,
child: Column(
children: <Widget>[
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
children: [
widget.title.toText24(isBold: true),
21.height,
LocaleKeys.search.tr().toText16(),
11.height,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
children: [
Container(
padding: const EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.transparent, border: Border.all(color: const Color(0xffefefef), width: 1)),
padding: EdgeInsets.only(left: 8, right: 4, top: 6, bottom: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.transparent,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row(
children: <Widget>[
children: [
Expanded(
child: InputWidget(
"Search By " + selectedType,
@ -260,18 +185,29 @@ class _DelegateSheetState extends State<DelegateSheet> {
verticalPadding: 3,
isInputTypeNum: selectedType == "Employee ID" ? true : false,
isEnable: isNeedEnableTextField,
onChange: (String v) {
onChange: (v) {
inputRes = v;
if (selectedType == "Favorites") {
searchFavUser();
}
},
),
),
Container(height: 36, width: 1, color: const Color(0xffE5E5E5)),
Container(
padding: const EdgeInsets.all(8),
child: Row(children: <Widget>[selectedType.toText12(), 4.width, const Icon(Icons.keyboard_arrow_down, color: Colors.black, size: 16)]),
height: 36,
width: 1,
color: Color(0xffE5E5E5),
),
Container(
padding: EdgeInsets.all(8),
child: Row(
children: [
selectedType.toText12(),
4.width,
const Icon(
Icons.keyboard_arrow_down,
color: Colors.black,
size: 16,
),
],
),
).onPress(() {
showMyBottomSheet(
context,
@ -283,17 +219,19 @@ class _DelegateSheetState extends State<DelegateSheet> {
if (value == "Workflow") {
setState(() {
isNeedEnableTextField = false;
// selectedFavLetter = null;
filteredFavUsersList = null;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
} else if (value == "Favorites") {
isNeedEnableTextField = true;
fetchFavUsers();
isNeedEnableTextField = false;
fetchFavLetters();
} else {
setState(() {
isNeedEnableTextField = true;
// selectedFavLetter = null;
filteredFavUsersList = null;
selectedFavLetter = null;
favLetters = null;
favUsersList = null;
});
}
},
@ -303,105 +241,143 @@ class _DelegateSheetState extends State<DelegateSheet> {
],
),
),
if (isNeedEnableTextField && selectedType != "Favorites")
if (isNeedEnableTextField)
TextButton(
onPressed: () {
fetchUserByInput();
},
child: const Text("Search", style: TextStyle(color: Colors.blue, decoration: TextDecoration.underline)),
),
child: const Text(
"Search",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
)
],
),
if (!isNeedEnableTextField) 12.height,
Row(
children: <Widget>[
children: [
Expanded(
child: SizedBox(
child: Container(
width: double.infinity,
child:
// selectedFavLetter == null && favLetters != null
// ? Container(width: double.infinity, alignment: Alignment.center, child: "Please select letter to see Fav results".toText12())
// :
filteredFavUsersList != null && selectedType == "Favorites"
child: selectedFavLetter == null && favLetters != null
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Please select letter to see Fav results".toText12(),
)
: favUsersList != null
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showFavUserItem(filteredFavUsersList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderColor, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8)).onPress(() {});
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: filteredFavUsersList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
itemBuilder: (context, index) {
return showFavUserItem(favUsersList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderColor,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
).onPress(() {});
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favUsersList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: isNeedEnableTextField && replacementList == null
? Container(width: double.infinity, alignment: Alignment.center, child: "Search User".toText12())
: isNeedEnableTextField && replacementList!.isEmpty
? Container(width: double.infinity, alignment: Alignment.center, child: "No Data Found".toText12())
: isNeedEnableTextField
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: replacementList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
: (widget.wFHistory != null
? ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showItgItem(widget.wFHistory![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.wFHistory!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)
: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (BuildContext context, int index) {
return Container(color: MyColors.borderE3Color, width: double.infinity, height: 1, margin: const EdgeInsets.only(top: 8, bottom: 8));
},
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.actionHistoryList!.length,
padding: const EdgeInsets.only(top: 8, bottom: 8),
)),
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "Search User".toText12(),
)
: isNeedEnableTextField && replacementList!.length == 0
? Container(
width: double.infinity,
alignment: Alignment.center,
child: "No Data Found".toText12(),
)
: isNeedEnableTextField
? ListView.separated(
itemBuilder: (context, index) {
return showInputUserItem(replacementList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: replacementList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: (widget.wFHistory != null
? ListView.separated(
itemBuilder: (context, index) {
return showItgItem(widget.wFHistory![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.wFHistory!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)
: ListView.separated(
itemBuilder: (context, index) {
return showItem(widget.actionHistoryList![index]);
},
separatorBuilder: (context, index) {
return Container(
color: MyColors.borderE3Color,
width: double.infinity,
height: 1,
margin: EdgeInsets.only(top: 8, bottom: 8),
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: widget.actionHistoryList!.length,
padding: EdgeInsets.only(top: 8, bottom: 8),
)),
),
),
// if (favLetters != null)
// SizedBox(
// width: 30,
// // color: Colors.red,
// child: ListView.separated(
// itemBuilder: (BuildContext context, int index) {
// return Container(
// padding: const EdgeInsets.all(8),
// alignment: Alignment.center,
// child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black),
// ).onPress(() {
// selectedFavLetter = favLetters![index].toUpperCase();
// fetchFavUsersList();
// });
// },
// separatorBuilder: (BuildContext context, int index) {
// return const SizedBox(height: 0);
// },
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: favLetters!.length,
// ),
// ),
if (favLetters != null)
Container(
width: 30,
// color: Colors.red,
child: ListView.separated(
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(8),
alignment: Alignment.center,
child: favLetters![index].toText14(color: selectedFavLetter == favLetters![index] ? MyColors.gradiantStartColor : Colors.black),
).onPress(() {
selectedFavLetter = favLetters![index].toUpperCase();
fetchFavUsersList();
});
},
separatorBuilder: (context, index) {
return SizedBox(
height: 0,
);
},
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: favLetters!.length,
),
),
],
),
],
@ -409,15 +385,22 @@ class _DelegateSheetState extends State<DelegateSheet> {
),
),
),
Container(width: double.infinity, height: 1, color: MyColors.borderColor),
Container(
width: double.infinity,
height: 1,
color: MyColors.borderColor,
),
DefaultButton(
"Cancel",
() {
Navigator.pop(context);
},
textColor: Colors.black,
colors: const <Color>[Color(0xffE6E6E6), Color(0xffE6E6E6)],
).insideContainer,
colors: [
Color(0xffE6E6E6),
Color(0xffE6E6E6),
],
).insideContainer
],
),
);
@ -427,22 +410,25 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
actionHistoryList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
actionHistoryList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
CircularAvatar(url: actionHistory.eMPLOYEEIMAGE ?? "", height: 30, width: 30, isImageBase64: true),
children: [
CircularAvatar(
url: actionHistory.eMPLOYEEIMAGE ?? "",
height: 30,
width: 30,
isImageBase64: true,
),
9.width,
(actionHistory.nAME ?? "").toText12().expanded,
IconButton(
@ -458,8 +444,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isFav: true,
);
},
icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor),
),
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);
@ -469,18 +459,25 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItgItemSheet(
"Comment",
apiMode: widget.apiMode,
wfHistory: wfHistory,
// notificationID: widget.notificationID,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItgItemSheet(
"Comment",
apiMode: widget.apiMode,
wfHistory: wfHistory,
// notificationID: widget.notificationID,
));
},
child: Row(children: <Widget>[CircularAvatar(height: 30, width: 30), 9.width, (wfHistory.name ?? "").toText12().expanded]),
child: Row(
children: [
CircularAvatar(
height: 30,
width: 30,
),
9.width,
(wfHistory.name ?? "").toText12().expanded,
],
),
);
}
@ -488,31 +485,47 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
favoriteReplacements: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
"Comment",
apiMode: widget.apiMode,
favoriteReplacements: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
actionHistory.employeeImage != "" && actionHistory.employeeImage != null
? CircularAvatar(url: actionHistory.employeeImage, height: 40, width: 40, isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false)
children: [
actionHistory.employeeImage != ""
? CircularAvatar(
url: actionHistory.employeeImage,
height: 40,
width: 40,
isImageBase64: (actionHistory.employeeImage != null || actionHistory.employeeImage!.isNotEmpty) ? true : false,
)
: isImageLoaded
? CircularAvatar(height: 40, width: 40, isImageBase64: false)
: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(50)),
child: Image.network("https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo", fit: BoxFit.cover, height: 40, width: 40).toShimmer(),
),
? CircularAvatar(
height: 40,
width: 40,
isImageBase64: false,
)
: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(50),
),
child: Image.network(
"https://play-lh.googleusercontent.com/NPo88ojmhah4HDiposucJmfQIop4z4xc8kqJK9ITO9o-yCab2zxIp7PPB_XPj2iUojo",
fit: BoxFit.cover,
height: 40,
width: 40,
).toShimmer(),
),
16.width,
Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()),
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
fetchChangeFav(
@ -524,8 +537,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isNeedToRefresh: true,
);
},
icon: const Icon(Icons.star, size: 16, color: MyColors.yellowColor),
),
icon: Icon(
Icons.star,
size: 16,
color: MyColors.yellowColor,
),
)
],
),
);
@ -535,24 +552,29 @@ class _DelegateSheetState extends State<DelegateSheet> {
return InkWell(
onTap: () {
Navigator.pop(context);
showMyBottomSheet(
context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: widget.apiMode,
replacementList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
),
);
showMyBottomSheet(context,
callBackFunc: widget.callBackFunc,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: widget.apiMode,
replacementList: actionHistory,
notificationID: widget.notificationID,
isITGRequest: widget.wFHistory != null,
getNotificationRespondAttributes: widget.getNotificationRespondAttributes,
));
},
child: Row(
children: <Widget>[
CircularAvatar(url: actionHistory.employeeImage, height: 30, width: 30, isImageBase64: actionHistory.employeeImage != null ? true : false),
children: [
CircularAvatar(
url: actionHistory.employeeImage,
height: 30,
width: 30,
isImageBase64: actionHistory.employeeImage != null ? true : false,
),
16.width,
Expanded(child: (actionHistory.employeeDisplayName ?? "").toText12()),
Expanded(
child: (actionHistory.employeeDisplayName ?? "").toText12(),
),
IconButton(
onPressed: () {
actionHistory.isFavorite = !(actionHistory.isFavorite ?? false);
@ -565,8 +587,12 @@ class _DelegateSheetState extends State<DelegateSheet> {
isNeedToRefresh: false,
);
},
icon: Icon(Icons.star, size: 16, color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor),
),
icon: Icon(
Icons.star,
size: 16,
color: (actionHistory.isFavorite ?? false) ? MyColors.yellowColor : MyColors.borderColor,
),
)
],
),
);

@ -61,7 +61,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
int animationIndex = 0;
PageController controller = PageController();
bool showFabOptions = false;
bool isShowActions = false;
WorkListResponseModel? workListData;
MemberInformationListModel? memberInformationListModel;
@ -145,7 +144,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
getEitNotificationBody();
} else if (workListData!.rEQUESTTYPE == "CEI") {
getCEINotificationBody();
} else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") {
}else if (workListData!.rEQUESTTYPE == "PHONE_NUMBERS") {
getPhonesNotificationBody();
} else if (workListData!.rEQUESTTYPE == "BASIC_DETAILS") {
getBasicDetNtfBody();
@ -287,7 +286,6 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
: ActionsFragment(
workListData!.nOTIFICATIONID,
actionHistoryList,
isShowActions,
voidCallback: reloadWorkList,
)
: showLoadingAnimation(),
@ -299,53 +297,51 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
],
).expanded,
if (isApproveAvailable || isRejectAvailable || isCloseAvailable)
SafeArea(
child: Container(
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
decoration: const BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0),
),
),
child: Row(
children: [
if (isRejectAvailable)
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction(rejectAction),
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction(approveAction),
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
],
Container(
padding: const EdgeInsets.only(top: 14, bottom: 14, left: 21, right: 21),
decoration: const BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(color: MyColors.lightGreyEFColor, width: 1.0),
),
),
child: Row(
children: [
if (isRejectAvailable)
DefaultButton(
LocaleKeys.reject.tr(),
() => performAction(rejectAction),
colors: const [Color(0xffE47A7E), Color(0xffDE6D71)],
).expanded,
if (isApproveAvailable && isRejectAvailable) 8.width,
if (isApproveAvailable)
DefaultButton(
LocaleKeys.approve.tr(),
() => performAction(approveAction),
colors: const [Color(0xff28C884), Color(0xff1BB271)],
).expanded,
if (isCloseAvailable)
DefaultButton(
LocaleKeys.ok.tr(),
() => performAction("CLOSE"),
colors: const [Color(0xff32D892), Color(0xff1AB170)],
).expanded,
8.width,
Container(
height: 43,
width: 43,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: MyColors.lightGreyE6Color,
),
child: Icon(showFabOptions ? Icons.more_vert_rounded : Icons.more_horiz_rounded, color: MyColors.darkIconColor),
).onPress(() {
setState(() {
showFabOptions = true;
});
})
],
),
)
],
),
@ -683,17 +679,10 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
}
void performAction(String actionMode, {String? title}) {
String question = "";
if (actionMode == "ANSWER_INFO") {
List<GetActionHistoryList> list = actionHistoryList.where((element) => element.aCTIONCODE == "REQUEST_INFO").toList();
if (list.isNotEmpty) {
question = "${list.first.aCTION}: ${list.first.nOTE}";
}
}
showDialog(
context: context,
builder: (BuildContext cxt) => AcceptRejectInputDialog(
message: question,
message: title != null ? null : LocaleKeys.requestedItems.tr(),
title: title,
notificationGetRespond: notificationNoteInput,
actionMode: actionMode,
@ -715,6 +704,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
"P_NOTIFICATION_ID": workListData!.nOTIFICATIONID,
"RespondAttributeList": responseAttribute,
};
if (actionMode == "APPROVED" ||
actionMode == "APPROVE" ||
actionMode == "CLOSE" ||
@ -1079,14 +1069,6 @@ 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) {
@ -1120,7 +1102,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
try {
isAttachmentLoaded = false;
getAttachmentList.clear();
List<GetAttachementList> _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!);
List<GetAttachementList> _getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!);
if (!isAttachmentLoaded) {
getAttachmentList = _getAttachmentList;
}

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

@ -760,18 +760,6 @@ 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 ?? ""),
@ -909,18 +897,15 @@ 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,27 +1,22 @@
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 showLogo = false,
String? logoPath,
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 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(
@ -31,10 +26,8 @@ AppBar AppBarWidget(
}, context),
child: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
),
if (showLogo) 4.width,
if (showLogo) SvgPicture.asset(logoPath!),
4.width,
if (!showLogo)title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
title.toText24(color: MyColors.darkTextColor, isBold: true).expanded,
],
),
centerTitle: false,
@ -62,7 +55,7 @@ AppBar AppBarWidget(
},
icon: const Icon(Icons.people, color: MyColors.textMixColor),
),
...actions ?? [],
...actions ?? []
],
);
}

@ -13,8 +13,6 @@ 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( borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
decoration: BoxDecoration(color: Theme.of(context).scaffoldBackgroundColor, borderRadius: const BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))),
child: SafeArea(
top: false,
child: Column(

@ -53,9 +53,8 @@ class ItemDetailViewGridItem extends StatelessWidget {
final String? type;
final bool isNeedToShowEmptyDivider;
final int maxLine;
final bool showSpaceAfterLine;
ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.showSpaceAfterLine = false, this.type = "", this.maxLine = 6}) : super(key: key);
ItemDetailViewGridItem(this.index, this.title, this.value, {Key? key, this.isNeedToShowEmptyDivider = false, this.type = "", this.maxLine = 6}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -93,7 +92,7 @@ class ItemDetailViewGridItem extends StatelessWidget {
: (value!.isEmpty ? "--" : value).toString().toText12Auto(color: MyColors.normalTextColor, maxLine: maxLine)
: Container(),
],
).paddingOnly(top: showSpaceAfterLine ? 16 : 0),
),
);
}
}

@ -44,7 +44,7 @@ class Location {
AppPermissions.location((granted) {
if (granted) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: const Duration(seconds: 10)).then((value) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.lowest, timeLimit: const Duration(seconds: 10)).then((value) {
done(value);
}).catchError((err) {
errorCallBack();

@ -78,10 +78,11 @@ class _NfcLayoutState extends State<NfcLayout> {
}
Widget scanNfc() {
return Container(
key: ValueKey(1),
width: double.infinity,
return SizedBox(
width: MediaQuery.sizeOf(context).width,
child: Column(
key: ValueKey(1),
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
@ -139,8 +140,9 @@ class _NfcLayoutState extends State<NfcLayout> {
Widget doneNfc() {
return Container(
key: ValueKey(2),
width: MediaQuery.sizeOf(context).width,
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,9 +11,8 @@ class QrScannerDialog extends StatefulWidget {
class _QrScannerDialogState extends State<QrScannerDialog> {
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
// Barcode? result;
// QRViewController? controller;
Barcode? _barcode;
Barcode? result;
QRViewController? controller;
bool isPicked = false;
@override
@ -27,7 +26,10 @@ class _QrScannerDialogState extends State<QrScannerDialog> {
children: [
Expanded(
flex: 1,
child: MobileScanner(key : qrKey,onDetect: _handleBarcode),
child: QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
),
),
// Expanded(
// flex: 1,
@ -53,25 +55,25 @@ class _QrScannerDialogState extends State<QrScannerDialog> {
);
}
void _handleBarcode(BarcodeCapture barcodes) {
// this.controller = controller;
Barcode? data = barcodes.barcodes.firstOrNull;
if(data == null || isPicked) {
return;
}
// controller.scannedDataStream.listen((scanData) {
void _onQRViewCreated(QRViewController controller) {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {
setState(() {
// result = scanData;
result = scanData;
if (!isPicked) {
isPicked = true;
Navigator.pop(context, data.displayValue);
Navigator.pop(context, result!.code);
}
});
// });
// controller.pauseCamera();
// controller.resumeCamera();
});
controller.pauseCamera();
controller.resumeCamera();
}
@override
void dispose() {
controller?.dispose();
super.dispose();
}
}

@ -16,9 +16,8 @@ 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.6.8+300078
#version: 3.9.1+1
#version: 3.3.01+300040
version: 3.7.98+3
environment:
sdk: ^3.7.0
@ -41,13 +40,13 @@ dependencies:
injector: ^2.0.0
provider: ^6.0.1
easy_localization: ^3.0.0
http: ^1.4.0
http: ^1.3.0
permission_handler: ^12.0.1
flutter_svg: any
sizer: ^2.0.15
local_auth: ^2.3.0
fluttertoast: ^8.0.8
syncfusion_flutter_calendar: ^29.1.38
syncfusion_flutter_calendar: ^28.2.4
# flutter_calendar_carousel: ^2.1.0
pie_chart: ^5.1.0
shared_preferences: ^2.0.12
@ -57,8 +56,7 @@ dependencies:
flutter_countdown_timer: ^4.1.0
platform_device_id_plus: ^1.0.7
device_info_plus: ^11.5.0
image_picker: ^1.1.2
image_picker: ^0.8.5+3
file_picker: ^8.3.1
geolocator: ^9.0.2
month_year_picker: ^0.5.0+1
@ -67,16 +65,15 @@ dependencies:
open_filex: ^4.6.0
wifi_iot: ^0.3.19+1
flutter_html: ^3.0.0-alpha.6
mobile_scanner: ^6.0.10
# flutter_barcode_scanner: ^2.0.0
# qr_code_scanner: ^1.0.1
qr_code_scanner: ^1.0.1
# qr_flutter: ^4.0.0
url_launcher: ^6.0.15
share_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.66.0
fl_chart: ^0.70.2
# lottie json animations
lottie: any
# Marathon Card Swipe
@ -92,13 +89,12 @@ dependencies:
logging: ^1.0.1
swipe_to: ^1.0.2
flutter_webrtc: ^0.12.11
# camera: ^0.10.3
camera: ^0.11.2
camera: ^0.10.3
flutter_local_notifications: ^18.0.1
#firebase_analytics: any
#Chat Voice Message Recoding & Play
audio_waveforms: ^1.3.0
audio_waveforms: ^0.1.5+1
rxdart: ^0.27.7
#Encryption
@ -112,7 +108,7 @@ dependencies:
#Huawei Dependencies
# huawei_hmsavailability: ^6.6.0+300
# huawei_location: 6.0.0+302
huawei_location: ^6.14.2+301
huawei_location: ^6.11.0+301
# huawei_push: ^6.7.0+300
huawei_map:
@ -126,15 +122,14 @@ dependencies:
firebase_crashlytics: ^4.3.9
#Items for sale Image Carousel Slider
carousel_slider: ^5.1.1
carousel_slider: ^5.0.0
#Huawei Specified
# store_checker: ^1.1.0
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

Loading…
Cancel
Save