Compare commits

..

No commits in common. 'cca95cee6a65146e2021d327e9a3b6e90ce5f6dd' and '515ffef14ea72653273cb4fd08239729a635990d' have entirely different histories.

@ -20,7 +20,6 @@ android {
namespace 'hmg.cloudSolutions.mohem' namespace 'hmg.cloudSolutions.mohem'
compileSdk 36 compileSdk 36
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
} }
@ -36,11 +35,6 @@ android {
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode flutter.versionCode versionCode flutter.versionCode
versionName flutter.versionName versionName flutter.versionName
multiDexEnabled true
}
compileOptions {
coreLibraryDesugaringEnabled true
} }
signingConfigs { signingConfigs {
@ -70,6 +64,4 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20" 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.0.3'
} }

@ -391,7 +391,7 @@
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 15.6; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -530,7 +530,7 @@
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 15.6; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -561,7 +561,7 @@
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Mohemm; INFOPLIST_KEY_CFBundleDisplayName = Mohemm;
IPHONEOS_DEPLOYMENT_TARGET = 15.6; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

@ -170,21 +170,6 @@ class DashboardApiClient {
); );
} }
Future<GenericResponseModel?> getTicketBalance() async {
String url = "${ApiConsts.erpRest}GET_TICKET_BALANCE";
Map<String, dynamic> postParams = {"P_USER_NAME": AppState().memberInformationList?.eMPLOYEENUMBER};
postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject(
(json) {
GenericResponseModel responseData = GenericResponseModel.fromJson(json);
return responseData;
},
url,
postParams,
);
}
Future<SSOAuthModel?> getBookingSSOAuthRedirection({required String clientID}) async { Future<SSOAuthModel?> getBookingSSOAuthRedirection({required String clientID}) async {
String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm"; String url = "${ApiConsts.ssoAuthRedirection}?grantType=mohemm";
//https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm' //https://sso-uat.hmg.com/api/auth/connect?grantType=mohemm'
@ -195,7 +180,6 @@ class DashboardApiClient {
"PersonId": AppState().memberInformationList?.eMPLOYEENUMBER, "PersonId": AppState().memberInformationList?.eMPLOYEENUMBER,
"Username": AppState().memberInformationList?.eMPLOYEENUMBER, "Username": AppState().memberInformationList?.eMPLOYEENUMBER,
"Language": "US", "Language": "US",
"SessionId": AppState().postParamsObject?.pSessionId,
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject( return await ApiClient().postJsonForObject(
@ -209,8 +193,7 @@ class DashboardApiClient {
} }
Future<dynamic> getBookingSSOFinalRedirection({required String token}) async { Future<dynamic> getBookingSSOFinalRedirection({required String token}) async {
token = token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
"eyJhbGciOiJSUzI1NiIsImtpZCI6IjhjZTE2OWM0YjIwYjQ2ZWM5YTQyOTU3Y2ZhODUzNzQ1IiwidHlwIjoiSldUIn0.eyJ0ZW5hbnRfaWQiOiJhOWY0ZDFhMDU5NmQ0YWVhOGY4MzA5OTJlYzRiZGFjMSIsImVpZCI6IjExNzkzMCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6Ijk2MDI0OGM1NzA3YzQ3MmFhYTEzM2I1N2ZhODE1ZmVhIiwibGFuZ3VhZ2UiOiJVUyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6IjExNzkzMEBobWcuY29tIiwiZXhwIjoxNzgyNDc1NzY5LCJpc3MiOiJodHRwczovL3Nzby11YXQuaG1nLmNvbSIsImF1ZCI6ImE5ZjRkMWEwNTk2ZDRhZWE4ZjgzMDk5MmVjNGJkYWMxIn0.rJcLVsG8D0XECyLERCTD2uqGeWyvp-OBVGE9uL2qKrX4etFUHgdFt_5kYF6edFTtGy-0PIZadHDmv7e-IOhVWHm5HVMClaukiXoRXR8cDN8XA1wfme3Kd-U5PXN-IRh49AyRTzLO0rYNPvH81ScosWGlsFSkOvA-0hJNa2adHdtvgNvB8wJshSU5p7sAmF8mjdDY6aInG19etu2iEuUDwHHA4ZY_ts4hboHo8fE392hFaYGonExoD7bpW5RMx5xKWeRCmWpG_PK8Aw_z1jGzdB9PANus4pteRGuln1J-kmo2lQC9pVrSyZATAKp1HfgfyZ_vUhaHEfM69cMWaCslJQ";
var request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG')); var request = http.MultipartRequest('POST', Uri.parse('https://ek.techmaster.in/SSO/HMG'));
request.fields.addAll({'JWTToken': token}); request.fields.addAll({'JWTToken': token});

@ -48,7 +48,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
double get leaveBalance => leaveBalanceAccrual?.accrualNetEntitlement ?? 0; double get leaveBalance => leaveBalanceAccrual?.accrualNetEntitlement ?? 0;
double ticketBalance = 0; double ticketBalance = 0;
double walletBalance = 0;
//Menu Entries //Menu Entries
bool isServicesMenusLoading = true; bool isServicesMenusLoading = true;
@ -57,7 +56,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<GetMenuEntriesList>? getMenuEntriesList; List<GetMenuEntriesList>? getMenuEntriesList;
EventActivityList? eventActivity; EventActivityList? eventActivity;
TicketBookingResult? ticketBookingResponse;
//Offers And Discounts //Offers And Discounts
bool isOffersLoading = true; bool isOffersLoading = true;
@ -203,8 +201,6 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList![0]; leaveBalanceAccrual = accrualList![0];
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0); ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0);
walletBalance = (accrualList![4].accrualNetEntitlement ?? 0.0);
print("================ Ticket Balance: $ticketBalance ===============");
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
@ -289,34 +285,19 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
} }
Future<void> fetchTicketBooking() async { Future<TicketBookingResult> fetchTicketBooking() async {
try { try {
GenericResponseModel? genericResponseModel = await DashboardApiClient().getTicketBookingRedirection(); GenericResponseModel? genericResponseModel = await DashboardApiClient().getTicketBookingRedirection();
if (genericResponseModel?.portalDirectionData?.pRedirection!.toLowerCase() == "alma") { if (genericResponseModel?.portalDirectionData?.pRedirection!.toLowerCase() == "alma") {
ticketBookingResponse = TicketBookingResult(true, genericResponseModel?.portalDirectionData?.clientID); return TicketBookingResult(true, genericResponseModel?.portalDirectionData?.clientID);
return;
} }
ticketBookingResponse = TicketBookingResult(false, null); return TicketBookingResult(false, null);
} catch (ex) { } catch (ex) {
logger.wtf(ex); logger.wtf(ex);
isEventLoadingLoading = false; isEventLoadingLoading = false;
notifyListeners(); notifyListeners();
Utils.handleException(ex, null, null); Utils.handleException(ex, null, null);
ticketBookingResponse = TicketBookingResult(false, null); // Ensure a return value in case of an exception return TicketBookingResult(false, null); // Ensure a return value in case of an exception
}
}
void fetchTicketBalance() async {
try {
GenericResponseModel? ticketResponse = await DashboardApiClient().getTicketBalance();
logger.d("Ticket Balance Response: ${ticketResponse?.toJson()}");
print(" ========= Ticket Balance Response ======= ");
} catch (ex) {
logger.wtf(ex);
isEventLoadingLoading = false;
notifyListeners();
Utils.handleException(ex, null, null);
// ticketBookingResponse = TicketBookingResult(false, null); // Ensure a return value in case of an exception
} }
} }

@ -148,7 +148,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
data.fetchAttendanceTracking(context); data.fetchAttendanceTracking(context);
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
data.fetchMissingSwipe(context); data.fetchMissingSwipe(context);
data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries(); data.fetchMenuEntries();
data.fetchEventActivity(); data.fetchEventActivity();
@ -160,12 +159,6 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
} }
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
await data.fetchTicketBooking();
// if (data.ticketBookingResponse != null && !data.ticketBookingResponse!.success) {
// // data.fetchTicketBalance();
// }
//continue here
} }
int ermIndex = 0; int ermIndex = 0;
@ -182,11 +175,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
if (list[ermIndex].notificationType == "Survey") { if (list[ermIndex].notificationType == "Survey") {
await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first); await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first);
} else { } else {
await Navigator.pushNamed( await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
context, "masterId": list[ermIndex].notificationMasterId,
AppRoutes.advertisement, "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement,
arguments: {"masterId": list[ermIndex].notificationMasterId, "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement}, });
);
} }
} }
ermIndex++; ermIndex++;
@ -249,44 +241,53 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
children: [ children: [
Row( Row(
children: [ children: [
Builder( Builder(builder: (BuildContext context) {
builder: (BuildContext context) { return Row(
return Row( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: [
children: [ Image.memory(
Image.memory( Utils.dataFromBase64String(
Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""), AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) { ),
return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34); errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
}, return SvgPicture.asset(
width: 34, "assets/images/user.svg",
height: 34, height: 34,
fit: BoxFit.cover, width: 34,
).circle(50), );
// CircularAvatar( },
// width: 34, width: 34,
// height: 34, height: 34,
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", fit: BoxFit.cover,
// ), ).circle(50),
8.width, // CircularAvatar(
SvgPicture.asset("assets/images/side_nav.svg"), // width: 34,
], // height: 34,
).onPress(() { // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
_scaffoldState.currentState!.openDrawer(); // ),
}); 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, Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async { SvgPicture.asset(
"assets/images/announcements.svg",
matchTextDirection: true,
).onPress(() async {
await Navigator.pushNamed(context, AppRoutes.announcements); await Navigator.pushNamed(context, AppRoutes.announcements);
}), })
], ],
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7), ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
Expanded( Expanded(
child: SmartRefresher( child: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
header: const MaterialClassicHeader(color: MyColors.gradiantEndColor), header: const MaterialClassicHeader(
color: MyColors.gradiantEndColor,
),
controller: _refreshController, controller: _refreshController,
onRefresh: () { onRefresh: () {
_onRefresh(false); _onRefresh(false);
@ -310,155 +311,161 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
return (model.isAttendanceTrackingLoading return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer() ? GetAttendanceTrackingShimmer()
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
gradient: const LinearGradient( gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
transform: GradientRotation(.46), MyColors.gradiantEndColor,
begin: Alignment.topRight, MyColors.gradiantStartColor,
end: Alignment.bottomLeft, ]),
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
), ),
), child: Stack(
child: Stack( alignment: Alignment.center,
alignment: Alignment.center, children: [
children: [ if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
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(
children: [ children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), Expanded(
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white), child: Column(
if (model.isTimeRemainingInSeconds != 0)
Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
9.height, LocaleKeys.checkIn.tr().toText12(color: Colors.white),
Directionality( (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
textDirection: ui.TextDirection.ltr, .toString()
child: CountdownTimer( .toText14(color: Colors.white, isBold: true),
endTime: model.endTime, 4.height,
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(left: 12, right: 12),
], ),
).paddingOnly(top: 12, right: 15, left: 12), Container(
), margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
Row( width: 45,
children: [ height: 45,
Expanded( padding: const EdgeInsets.only(left: 10, right: 10),
child: Column( decoration: BoxDecoration(
mainAxisSize: MainAxisSize.min, color: Color(0xff259EA4),
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.only(
children: [ bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
LocaleKeys.checkIn.tr().toText12(color: Colors.white), bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
(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"),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"), ).onPress(() {
).onPress(() { showMyBottomSheet(
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true)); context,
}), callBackFunc: () {},
], child: MarkAttendanceWidget(model, isFromDashboard: true),
), );
], }),
), ],
], ),
), ],
).onPress(() { ),
Navigator.pushNamed(context, AppRoutes.todayAttendance); ],
})) ),
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither(); .animatedSwither();
}, },
), ),
), ),
), ),
9.width, 9.width,
Expanded(child: MenusWidget()), Expanded(
child: MenusWidget(),
),
], ],
), ),
], ],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
eventActivityWidget(context), eventActivityWidget(context),
Consumer<DashboardProviderModel>( Consumer<DashboardProviderModel>(builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { if (!model.isOffersLoading && model.getOffersList.isEmpty) {
if (!model.isOffersLoading && model.getOffersList.isEmpty) { return const SizedBox();
return const SizedBox(); }
} return Column(
return Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Row(
Row( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Expanded(
Expanded( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: [
children: [ LocaleKeys.offers.tr().toText12(),
LocaleKeys.offers.tr().toText12(), Row(
Row( children: [
children: [ LocaleKeys.discounts.tr().toText24(isBold: true),
LocaleKeys.discounts.tr().toText24(isBold: true), 6.width,
6.width, Container(
Container(
padding: const EdgeInsets.only(left: 8, right: 8), padding: const EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(color: MyColors.yellowColor, borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(
child: LocaleKeys.newString.tr().toText10(isBold: true), 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); LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
}), Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
], })
).paddingOnly(left: 21, right: 21), ],
Consumer<DashboardProviderModel>( ).paddingOnly(left: 21, right: 21),
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { Consumer<DashboardProviderModel>(
return SizedBox( builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
height: 103 + 33, return SizedBox(
child: ListView.separated( height: 103 + 33,
child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13), padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
@ -467,53 +474,57 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
return model.isOffersLoading return model.isOffersLoading
? const OffersShimmerWidget() ? const OffersShimmerWidget()
: InkWell( : InkWell(
onTap: () { onTap: () {
navigateToDetails(data.getOffersList[index]); navigateToDetails(data.getOffersList[index]);
}, },
child: SizedBox( child: SizedBox(
width: 73, width: 73,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: 73, width: 73,
height: 73, height: 73,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(100)), borderRadius: const BorderRadius.all(
border: Border.all(color: MyColors.lightGreyE3Color, width: 1), Radius.circular(100),
), ),
child: ClipRRect( border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
borderRadius: const BorderRadius.all(Radius.circular(50)), ),
child: Hero( child: ClipRRect(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!, borderRadius: const BorderRadius.all(
transitionOnUserGestures: true, Radius.circular(50),
child: Image.network(data.getOffersList[index].logo ?? "", fit: BoxFit.contain), ),
child: Hero(
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
transitionOnUserGestures: true,
child: Image.network(
data.getOffersList[index].logo ?? "",
fit: BoxFit.contain,
),
),
), ),
), ),
), 4.height,
4.height, Expanded(
Expanded( child: AppState().isArabic(context)
child: ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
AppState().isArabic(context) : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
? 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, separatorBuilder: (BuildContext cxt, int index) => 8.width,
itemCount: 9, itemCount: 9),
), );
); },
}, ),
), ],
], );
); }),
},
),
Container( Container(
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.only(top: 31), padding: const EdgeInsets.only(top: 31),
@ -577,24 +588,38 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
), ),
), ),
), ),
), )
], ],
), ),
drawer: SafeArea(child: AppDrawer(onLanguageChange: _onRefresh)), drawer: SafeArea(
child: AppDrawer(onLanguageChange: _onRefresh),
),
bottomNavigationBar: SizedBox( bottomNavigationBar: SizedBox(
height: Platform.isAndroid ? 70 : 100, height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar( child: BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), 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(), label: LocaleKeys.mowadhafhiRequest.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Stack( icon: Stack(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
children: [ children: [
SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), SvgPicture.asset(
"assets/icons/work_list.svg",
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
Consumer<DashboardProviderModel>( Consumer<DashboardProviderModel>(
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) { builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
if (data.workListCounter == 0) { if (data.workListCounter == 0) {
@ -617,7 +642,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
label: LocaleKeys.workList.tr(), label: LocaleKeys.workList.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg",
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(), label: LocaleKeys.itemsForSale.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
@ -626,29 +654,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/icons/chat/chat.svg", "assets/icons/chat/chat.svg",
color: color: !checkIfPrivilegedForChat()
!checkIfPrivilegedForChat() ? MyColors.lightGreyE3Color
? MyColors.lightGreyE3Color : currentIndex == 4
: currentIndex == 4
? MyColors.grey3AColor ? MyColors.grey3AColor
: cProvider.disbaleChatForThisUser : cProvider.disbaleChatForThisUser
? MyColors.lightGreyE3Color ? MyColors.lightGreyE3Color
: MyColors.grey98Color, : MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
Consumer<ChatProviderModel>( Consumer<ChatProviderModel>(
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
return !checkIfPrivilegedForChat() return !checkIfPrivilegedForChat()
? const SizedBox() ? const SizedBox()
: Positioned( : Positioned(
right: 0, right: 0,
top: 0, top: 0,
child: Container( child: Container(
padding: const EdgeInsets.only(left: 4, right: 4), padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)), decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.chatUConvCounter.toString().toText10(color: Colors.white), child: data.chatUConvCounter.toString().toText10(color: Colors.white),
), ),
); );
}, },
), ),
], ],
@ -685,9 +712,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
Widget eventActivityWidget(BuildContext context) { Widget eventActivityWidget(BuildContext context) {
return (context.watch<DashboardProviderModel>().isEventLoadingLoading) return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) ? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
: (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive == true) : (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive ==true)
? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0) ? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
: const SizedBox(); : const SizedBox();
} }
void navigateToDetails(OffersListModel offersListModelObj) { void navigateToDetails(OffersListModel offersListModelObj) {

@ -27,99 +27,114 @@ class MenusWidget extends StatelessWidget {
children: [ children: [
data.isWorkListLoading data.isWorkListLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context, showLoading: true); data.fetchWorkListCounter(context, showLoading: true);
}) })
: Container( : Container(
decoration: BoxDecoration(color: Color(namesColor[0]), borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(
child: Column( color: Color(namesColor[0]),
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(10),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ child: Column(
LocaleKeys.workList.tr().toText12(color: Colors.white), mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1)), LocaleKeys.workList.tr().toText12(color: Colors.white),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), Row(
], children: [
), Expanded(
], child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ),
).onPress(() { RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
Navigator.pushNamed(context, AppRoutes.workList); ],
}), )
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.workList);
}),
data.isMissingSwipeLoading data.isMissingSwipeLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration(color: Color(namesColor[1]), borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(
child: Column( color: Color(namesColor[1]),
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(10),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ child: Column(
LocaleKeys.missingSwipes.tr().toText12(color: Colors.white), mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1)), LocaleKeys.missingSwipes.tr().toText12(color: Colors.white),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), Row(
], children: [
), Expanded(
], child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ),
).onPress(() { RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS")); ],
}), )
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));
}),
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration(color: Color(namesColor[2]), borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(
child: Column( color: Color(namesColor[2]),
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(10),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ child: Column(
LocaleKeys.leaveBalance.tr().toText12(color: Colors.white), mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1)), LocaleKeys.leaveBalance.tr().toText12(color: Colors.white),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), Row(
], children: [
), Expanded(
], child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), ),
).onPress(() { RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
Navigator.pushNamed(context, AppRoutes.leaveBalance); ],
}), )
],
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.leaveBalance);
}),
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
}) })
: Container( : Container(
decoration: BoxDecoration(color: Color(namesColor[3]), borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(
child: Column( color: Color(namesColor[3]),
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(10),
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ child: Column(
data.ticketBookingResponse != null && data.ticketBookingResponse!.success mainAxisAlignment: MainAxisAlignment.spaceBetween,
? "Wallet Balance".toText12(color: Colors.white) crossAxisAlignment: CrossAxisAlignment.start,
: LocaleKeys.ticketBalance.tr().toText12(color: Colors.white), children: [
Row( LocaleKeys.ticketBalance.tr().toText12(color: Colors.white),
children: [ Row(
Expanded( children: [
child: Expanded(
data.ticketBookingResponse != null && data.ticketBookingResponse!.success child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
? data.walletBalance.toStringAsFixed(0).toText16(color: Colors.white, isBold: true, maxlines: 1) ),
: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
), ],
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), )
], ],
), ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6),
], ).onPress(
).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), () {
).onPress(() { Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS"));
Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.ticketBalance.tr(), "HMG_TKT_NEW_EIT_SS")); },
}), )
], ],
); );
}, },

@ -255,14 +255,14 @@ class ServicesWidget extends StatelessWidget {
} else { } else {
if (menuEntry.menuName == "HMG_TICKET_REQUESTS") { if (menuEntry.menuName == "HMG_TICKET_REQUESTS") {
Utils.showLoading(context); Utils.showLoading(context);
//Ticket Work TicketBookingResult response = await pro.fetchTicketBooking();
if (pro.ticketBookingResponse != null && pro.ticketBookingResponse!.success) { Utils.hideLoading(context);
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: pro.ticketBookingResponse!.clientId); if (response.success) {
SSOAuthModel? ssoToken = await pro.fetchSSOAuthRedirection(clientID: response.clientId);
if (ssoToken != null) { if (ssoToken != null) {
logger.d(ssoToken.data!.toJson()); logger.d(ssoToken.data!.toJson());
logger.d(ssoToken.data!.accessToken); logger.d(ssoToken.data!.accessToken);
dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!); dynamic url = await pro.fetchURLRedirection(token: ssoToken.data!.accessToken!);
Utils.hideLoading(context);
Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!))); Navigator.push(context, MaterialPageRoute(builder: (context) => SsoLoginWebView(url: url ?? "", jwtToken: ssoToken.data!.accessToken!)));
} }
} else { } else {

Loading…
Cancel
Save