dashboard changes.

merge-requests/3/head
Sikander Saleem 3 years ago
parent 5f7c135346
commit 24b09ed7f3

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -1,12 +1,10 @@
import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart'; import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server static String baseUrl = "https://uathrmsys.moenergy.gov.sa"; //MOE UAT
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server // static String baseUrl = "https://hrmsys.moenergy.gov.sa"; // MOE ;LIVE
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/"; static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String swpRest = baseUrlServices + "SWP.svc/REST/"; static String swpRest = baseUrlServices + "SWP.svc/REST/";

@ -98,7 +98,8 @@ class Utils {
static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) { static void handleException(dynamic exception, cxt, Function(String)? onErrorMessage) {
String errorMessage; String errorMessage;
if (exception.error.errorType != null && exception.error.errorType == 4) { print("exception:$exception");
if (exception?.error?.errorType != null && exception.error.errorType == 4) {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.appUpdateScreen, (_) => false, arguments: exception.error?.errorMessage); Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.appUpdateScreen, (_) => false, arguments: exception.error?.errorMessage);
} else { } else {
if (exception is APIException) { if (exception is APIException) {

@ -1,9 +1,8 @@
// ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final // ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final
Map<String, dynamic> env = { // link to generate dart class https://www.webinovers.com/web-tools/json-to-dart-convertor
"appConfig": "lib/config/config_en.json",
// Worklist (Dynamic ListView, Dynamic Forms, Dynamic Submission)
Map<String, dynamic> _env = {
"appConfig": "lib/config/config_en.json",
"login": { "login": {
"verification": true, "verification": true,
"verificationMethod": { "verificationMethod": {
@ -21,6 +20,7 @@ Map<String, dynamic> env = {
"monthlyAttendance": false, "monthlyAttendance": false,
"vocationRules": false, "vocationRules": false,
}, },
"itg": false,
"marathon": false, "marathon": false,
"offersDiscount": false, "offersDiscount": false,
"myTeams": false, "myTeams": false,
@ -32,4 +32,175 @@ Map<String, dynamic> env = {
"chat": false, "chat": false,
"monthlyAttendance": false, "monthlyAttendance": false,
"vocationRules": false, "vocationRules": false,
"canEdit": false,
}; };
Env env = Env.fromJson(_env);
class Env {
Env({
required this.appConfig,
required this.login,
required this.bottomBar,
required this.dashboard,
required this.itg,
required this.marathon,
required this.offersDiscount,
required this.myTeams,
required this.modifiy,
required this.myRequest,
required this.pendingTransactions,
required this.myProfile,
required this.itemsForSale,
required this.chat,
required this.monthlyAttendance,
required this.vocationRules,
required this.canEdit,
});
late final String appConfig;
late final Login login;
late final bool bottomBar;
late final Dashboard dashboard;
late final bool itg;
late final bool marathon;
late final bool offersDiscount;
late final bool myTeams;
late final bool modifiy;
late final bool myRequest;
late final bool pendingTransactions;
late final bool myProfile;
late final bool itemsForSale;
late final bool chat;
late final bool monthlyAttendance;
late final bool vocationRules;
late final bool canEdit;
Env.fromJson(Map<String, dynamic> json) {
appConfig = json['appConfig'];
login = Login.fromJson(json['login']);
bottomBar = json['bottomBar'];
dashboard = Dashboard.fromJson(json['dashboard']);
marathon = json['marathon'];
itg = json['itg'];
offersDiscount = json['offersDiscount'];
myTeams = json['myTeams'];
modifiy = json['modifiy'];
myRequest = json['myRequest'];
pendingTransactions = json['pendingTransactions'];
myProfile = json['myProfile'];
itemsForSale = json['itemsForSale'];
chat = json['chat'];
monthlyAttendance = json['monthlyAttendance'];
vocationRules = json['vocationRules'];
canEdit = json['canEdit'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['appConfig'] = appConfig;
_data['login'] = login.toJson();
_data['bottomBar'] = bottomBar;
_data['dashboard'] = dashboard.toJson();
_data['marathon'] = marathon;
_data['itg'] = itg;
_data['offersDiscount'] = offersDiscount;
_data['myTeams'] = myTeams;
_data['modifiy'] = modifiy;
_data['myRequest'] = myRequest;
_data['pendingTransactions'] = pendingTransactions;
_data['myProfile'] = myProfile;
_data['itemsForSale'] = itemsForSale;
_data['chat'] = chat;
_data['monthlyAttendance'] = monthlyAttendance;
_data['vocationRules'] = vocationRules;
_data['canEdit'] = canEdit;
return _data;
}
}
class Login {
Login({
required this.verification,
required this.verificationMethod,
required this.forgetPassword,
});
late final bool verification;
late final VerificationMethod verificationMethod;
late final bool forgetPassword;
Login.fromJson(Map<String, dynamic> json) {
verification = json['verification'];
verificationMethod = VerificationMethod.fromJson(json['verificationMethod']);
forgetPassword = json['forgetPassword'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['verification'] = verification;
_data['verificationMethod'] = verificationMethod.toJson();
_data['forgetPassword'] = forgetPassword;
return _data;
}
}
class VerificationMethod {
VerificationMethod({
required this.whatsapp,
});
late final bool whatsapp;
VerificationMethod.fromJson(Map<String, dynamic> json) {
whatsapp = json['whatsapp'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['whatsapp'] = whatsapp;
return _data;
}
}
class Dashboard {
Dashboard({
required this.attendance,
required this.worklist,
required this.ticketBalance,
required this.leaveBalance,
required this.missingSwipe,
required this.monthlyAttendance,
required this.vocationRules,
});
late final bool attendance;
late final bool worklist;
late final bool ticketBalance;
late final bool leaveBalance;
late final bool missingSwipe;
late final bool monthlyAttendance;
late final bool vocationRules;
Dashboard.fromJson(Map<String, dynamic> json) {
attendance = json['attendance'];
worklist = json['worklist'];
ticketBalance = json['ticketBalance'];
leaveBalance = json['leaveBalance'];
missingSwipe = json['missingSwipe'];
monthlyAttendance = json['monthlyAttendance'];
vocationRules = json['vocationRules'];
}
Map<String, dynamic> toJson() {
var _data = <String, dynamic>{};
_data['attendance'] = attendance;
_data['worklist'] = worklist;
_data['ticketBalance'] = ticketBalance;
_data['leaveBalance'] = leaveBalance;
_data['missingSwipe'] = missingSwipe;
_data['monthlyAttendance'] = monthlyAttendance;
_data['vocationRules'] = vocationRules;
return _data;
}
}

@ -1,6 +1,6 @@
class GetMobileLoginInfoListModel { class GetMobileLoginInfoListModel {
int? iD; int? iD;
int? employeeID; String? employeeID;
int? channelID; int? channelID;
int? companyID; int? companyID;
String? deviceType; String? deviceType;

@ -103,11 +103,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
drawerMenuItemList = [ drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile), DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation), // DrawerMenuItem("assets/images/drawer/performance_evaluation.svg", LocaleKeys.performanceEvaluation.tr(), AppRoutes.performanceEvaluation),
DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi), // DrawerMenuItem("assets/images/drawer/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions), // DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
// DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen), // // DrawerMenuItem("assets/images/drawer/drawer_marathon.svg", LocaleKeys.brainMarathon.tr(), AppRoutes.marathonIntroScreen),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword), // DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
//
]; ];
notifyListeners(); notifyListeners();
@ -139,15 +140,17 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList; getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList;
workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0; workListCounter = genericResponseModel?.pOPENNTFNUMBER ?? 0;
if (env.itg) itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0);
GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications(); if (env.itg) {
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
if (cocCount != null) { cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0); if (cocCount != null) {
workListCounter += cocFinalCount; cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
workListCounter += cocFinalCount;
}
} }
if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
@ -210,12 +213,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<ListMenu> menuList = await DashboardApiClient().getListMenu(); List<ListMenu> menuList = await DashboardApiClient().getListMenu();
List findMyRequest = menuList.where((element) => element.menuType == "E").toList(); List findMyRequest = menuList.where((element) => element.menuType == "E").toList();
if (findMyRequest.isNotEmpty) { if (findMyRequest.isNotEmpty) {
drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests)); drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
} }
List findMyTeam = menuList.where((element) => element.menuType == "M").toList(); List findMyTeam = menuList.where((element) => element.menuType == "M").toList();
if (findMyTeam.isNotEmpty) { if (findMyTeam.isNotEmpty) {
AppState().setempStatusIsManager = true; AppState().setempStatusIsManager = true;
drawerMenuItemList.insert(2, DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam)); drawerMenuItemList.add(DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
} }
} catch (ex) { } catch (ex) {
logger.wtf(ex); logger.wtf(ex);
@ -231,10 +234,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
homeMenus = parseMenus(getMenuEntriesList ?? []); homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) { if (homeMenus!.isNotEmpty) {
if(env["dashboard"]["monthlyAttendance"]) { if (env.dashboard.monthlyAttendance) {
homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr())); homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr()));
} }
if(env["dashboard"]["vocationRules"]) { if (env.dashboard.vocationRules) {
homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr())); homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr()));
} }
} }
@ -274,6 +277,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification(); MohemmItgResponseItem? res = await DashboardApiClient().getITGPageNotification();
return res; return res;
} }
void notify() { void notify() {
notifyListeners(); notifyListeners();
} }

@ -61,13 +61,13 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
super.initState(); super.initState();
scheduleMicrotask(() { scheduleMicrotask(() {
data = Provider.of<DashboardProviderModel>(context, listen: false); data = Provider.of<DashboardProviderModel>(context, listen: false);
if (env["marathon"]) { if (env.marathon) {
marathonProvider = Provider.of<MarathonProvider>(context, listen: false); marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
} }
if (env["chat"]) { if (env.chat) {
cProvider = Provider.of<ChatProviderModel>(context, listen: false); cProvider = Provider.of<ChatProviderModel>(context, listen: false);
_bHubCon();
} }
_bHubCon();
_onRefresh(true); _onRefresh(true);
}); });
} }
@ -141,21 +141,25 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
// print(value.result!.data!.notificationTitle); // print(value.result!.data!.notificationTitle);
// }); // });
data.fetchListMenu(); data.fetchListMenu();
if (env["dashboard"]["attendance"]) { if (env.dashboard.attendance) {
data.fetchAttendanceTracking(context); data.fetchAttendanceTracking(context);
} }
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
if (env["dashboard"]["missingSwipe"]) { if (env.dashboard.missingSwipe) {
data.fetchMissingSwipe(context); data.fetchMissingSwipe(context);
} }
data.fetchLeaveTicketBalance(context, DateTime.now()); data.fetchLeaveTicketBalance(context, DateTime.now());
data.fetchMenuEntries(); data.fetchMenuEntries();
data.getCategoryOffersListAPI(context); if (env.offersDiscount) {
if (env["marathon"]) { data.getCategoryOffersListAPI(context);
}
if (env.marathon) {
marathonProvider.getMarathonDetailsFromApi(); marathonProvider.getMarathonDetailsFromApi();
} }
if (env.chat) {
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon(); marathonProvider.getMarathonDetailsFromApi();
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
}
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
} }
@ -239,12 +243,12 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}); });
}), }),
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( // SvgPicture.asset(
"assets/images/announcements.svg", // "assets/images/announcements.svg",
matchTextDirection: true, // matchTextDirection: true,
).onPress(() async { // ).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(
@ -269,119 +273,119 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
16.height, 16.height,
Row( Row(
children: [ children: [
if (env["dashboard"]["attendance"]) if (env.dashboard.attendance)
Expanded( Expanded(
child: AspectRatio( child: AspectRatio(
aspectRatio: 159 / 159, aspectRatio: 159 / 159,
child: Consumer<DashboardProviderModel>( child: Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
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(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
MyColors.gradiantEndColor, MyColors.gradiantEndColor,
MyColors.gradiantStartColor, 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),
),
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/attendance.svg" : "assets/images/attendance.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),
], ],
).paddingOnly(top: 12, right: 15, left: 12), ),
), ],
Row( ),
children: [ ],
Expanded( ),
child: Column( ).onPress(
mainAxisSize: MainAxisSize.min, () {
crossAxisAlignment: CrossAxisAlignment.start, Navigator.pushNamed(context, AppRoutes.todayAttendance);
children: [ },
LocaleKeys.checkIn.tr().toText12(color: Colors.white), ))
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) .animatedSwither();
.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/attendance.svg" : "assets/images/attendance.svg"),
).onPress(() {
showMyBottomSheet(
context,
callBackFunc: () {},
child: MarkAttendanceWidget(model, isFromDashboard: true),
);
}),
],
),
],
),
],
),
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither();
},
), ),
), ),
), if (env.dashboard.attendance) 9.width,
if (env["dashboard"]["attendance"]) 9.width,
Expanded( Expanded(
child: MenusWidget(), child: MenusWidget(),
), ),
@ -389,102 +393,105 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
), ),
], ],
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21), ).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
Column( Visibility(
mainAxisSize: MainAxisSize.min, visible: env.offersDiscount,
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ mainAxisSize: MainAxisSize.min,
Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Row(
Expanded( crossAxisAlignment: CrossAxisAlignment.center,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
mainAxisSize: MainAxisSize.min, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
LocaleKeys.offers.tr().toText12(), mainAxisSize: MainAxisSize.min,
Row( children: [
children: [ LocaleKeys.offers.tr().toText12(),
LocaleKeys.discounts.tr().toText24(isBold: true), Row(
6.width, children: [
Container( LocaleKeys.discounts.tr().toText24(isBold: true),
padding: const EdgeInsets.only(left: 8, right: 8), 6.width,
decoration: BoxDecoration( Container(
color: MyColors.yellowColor, padding: const EdgeInsets.only(left: 8, right: 8),
borderRadius: BorderRadius.circular(10), decoration: BoxDecoration(
), color: MyColors.yellowColor,
child: LocaleKeys.newString.tr().toText10(isBold: true)), borderRadius: BorderRadius.circular(10),
], ),
), child: LocaleKeys.newString.tr().toText10(isBold: true)),
], ],
),
],
),
), ),
), LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); })
}) ],
], ).paddingOnly(left: 21, right: 21),
).paddingOnly(left: 21, right: 21), Consumer<DashboardProviderModel>(
Consumer<DashboardProviderModel>( builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
builder: (BuildContext context, DashboardProviderModel model, Widget? child) { return SizedBox(
return SizedBox( height: 103 + 33,
height: 103 + 33, child: ListView.separated(
child: ListView.separated( shrinkWrap: true,
shrinkWrap: true, physics: const BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(), padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
padding: const EdgeInsets.only(left: 21, right: 21, top: 13), scrollDirection: Axis.horizontal,
scrollDirection: Axis.horizontal, itemBuilder: (BuildContext cxt, int index) {
itemBuilder: (BuildContext cxt, int index) { 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(
borderRadius: const BorderRadius.all( Radius.circular(100),
Radius.circular(100), ),
), border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
),
child: ClipRRect(
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!, child: Hero(
fit: BoxFit.contain, 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: AppState().isArabic(context) ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1) : data.getOffersList[index].titleEn!.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,
@ -497,9 +504,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (env.marathon)
if (env["marathon"]) context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
context.watch<MarathonProvider>().isLoading ? const MarathonBannerShimmer().paddingAll(20) : const MarathonBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 8),
ServicesWidget(), ServicesWidget(),
], ],
), ),
@ -514,116 +520,116 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
drawer: SafeArea( drawer: SafeArea(
child: AppDrawer(onLanguageChange: _onRefresh), child: AppDrawer(onLanguageChange: _onRefresh),
), ),
bottomNavigationBar:!env["bottomBar"] bottomNavigationBar: !env.bottomBar
? null ? null
: SizedBox( : SizedBox(
height: Platform.isAndroid ? 70 : 100, height: Platform.isAndroid ? 70 : 100,
child: BottomNavigationBar( child: BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/home.svg", "assets/icons/home.svg",
color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color, color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.home.tr(), label: LocaleKeys.home.tr(),
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/create_req.svg", "assets/icons/create_req.svg",
color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color, color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4), ).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( SvgPicture.asset(
"assets/icons/work_list.svg", "assets/icons/work_list.svg",
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color, color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
).paddingAll(4), ).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) {
return const SizedBox(); return const SizedBox();
} }
return Positioned( return 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: MyColors.redColor, borderRadius: BorderRadius.circular(17)), decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white), child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
), ),
); ],
}, ),
label: LocaleKeys.workList.tr(),
), ),
], BottomNavigationBarItem(
), icon: SvgPicture.asset(
label: LocaleKeys.workList.tr(), "assets/icons/item_for_sale.svg",
), color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
BottomNavigationBarItem( ).paddingAll(4),
icon: SvgPicture.asset( label: LocaleKeys.itemsForSale.tr(),
"assets/icons/item_for_sale.svg", ),
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color, BottomNavigationBarItem(
).paddingAll(4), icon: Stack(
label: LocaleKeys.itemsForSale.tr(), alignment: Alignment.centerLeft,
), children: [
BottomNavigationBarItem( SvgPicture.asset(
icon: Stack( "assets/icons/chat/chat.svg",
alignment: Alignment.centerLeft, color: currentIndex == 4
children: [ ? MyColors.grey3AColor
SvgPicture.asset( : cProvider.disbaleChatForThisUser
"assets/icons/chat/chat.svg", ? MyColors.lightGreyE3Color
color: currentIndex == 4 : MyColors.grey98Color,
? MyColors.grey3AColor ).paddingAll(4),
: cProvider.disbaleChatForThisUser Consumer<ChatProviderModel>(
? MyColors.lightGreyE3Color builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
: MyColors.grey98Color, return Positioned(
).paddingAll(4), right: 0,
Consumer<ChatProviderModel>( top: 0,
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) { child: Container(
return Positioned( padding: const EdgeInsets.only(left: 4, right: 4),
right: 0, alignment: Alignment.center,
top: 0, decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: Container( child: data.chatUConvCounter.toString().toText10(color: Colors.white),
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(),
), ),
], ],
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) {
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) {
Navigator.pushNamed(context, AppRoutes.chat);
}
}
},
),
),
); );
} }

@ -117,9 +117,10 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.pushNamed(context, drawerMenuItemList[index].routeName); Navigator.pushNamed(context, drawerMenuItemList[index].routeName);
}); });
}), }),
menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())), // menuItem("assets/images/drawer/employee_id.svg", LocaleKeys.employeeDigitalID.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: EmployeeDigitialIdDialog())),
if (AppState().businessCardPrivilege) // if (AppState().businessCardPrivilege)
menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())), // menuItem("assets/images/drawer/view_business_card.svg", LocaleKeys.viewBusinessCard.tr(), "", closeDrawer: false, onPress: () => showMDialog(context, child: BusinessCardDialog())),
//
menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout), menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: performLogout),
// menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,); // menuItem("assets/images/drawer/logout.svg", LocaleKeys.logout.tr(), "", color: MyColors.redA3Color, closeDrawer: false, onPress: () {Navigator.pushNamed(context, AppRoutes.survey,);
], ],

@ -53,7 +53,7 @@ class MenusWidget extends StatelessWidget {
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.workList); Navigator.pushNamed(context, AppRoutes.workList);
}), }),
if(env["dashboard"]["missingSwipe"]) if(env.dashboard.missingSwipe)
data.isMissingSwipeLoading data.isMissingSwipeLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);
@ -108,7 +108,7 @@ class MenusWidget extends StatelessWidget {
).onPress(() { ).onPress(() {
Navigator.pushNamed(context, AppRoutes.leaveBalance); Navigator.pushNamed(context, AppRoutes.leaveBalance);
}), }),
if(env["dashboard"]["ticketBalance"]) if(env.dashboard.ticketBalance)
data.isLeaveTicketBalanceLoading data.isLeaveTicketBalanceLoading
? MenuShimmer().onPress(() { ? MenuShimmer().onPress(() {
data.fetchWorkListCounter(context); data.fetchWorkListCounter(context);

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
@ -69,7 +71,10 @@ class ServicesWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SvgPicture.asset(AppState().isArabic(context) ? getMenuIconAr(data.homeMenus![parentIndex].menuEntiesList[index].prompt!) : getMenuIconEn(data.homeMenus![parentIndex].menuEntiesList[index].prompt!)), Image.memory(
Base64Decoder().convert(data.homeMenus![parentIndex].menuEntiesList[index].icon ?? ""),
scale: 1.25,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [

@ -125,7 +125,7 @@ class _LoginScreenState extends State<LoginScreen> {
Future<void> checkPrefs() async { Future<void> checkPrefs() async {
String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username); String username = await Utils.getStringFromPrefs(SharedPrefsConsts.username);
if (username.isNotEmpty) { if (!username.isNotEmpty) { // for test purpose i added !
String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password); String password = await Utils.getStringFromPrefs(SharedPrefsConsts.password);
// String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken); // String firebaseToken = await Utils.getStringFromPrefs(SharedPrefsConsts.firebaseToken);
// print("firebaseToken:$firebaseToken"); // print("firebaseToken:$firebaseToken");
@ -166,22 +166,29 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isAppOpenBySystem == null) { if (isAppOpenBySystem == null) {
isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool; isAppOpenBySystem = (ModalRoute.of(context)!.settings.arguments ?? true) as bool;
if (!kReleaseMode) { if (!kReleaseMode) {
// username.text = "15444"; // Maha User username.text = "1100313582"; // Tamer User
// username.text = "15153"; // Tamer User password.text = "moe123456";
// password.text = "Abcd@1234";
username.text = "SRCA4779T"; // Hashim User
password.text = "a12345";
username.text = "SRCA04101"; // Hashim User // 1) Normal user :
password.text = "a123456"; // Username: 1100313582
// Employee # and Name: 210624 - شهد خالد ابراهيم الشامخ
// Password: moe123456
//
// 2) Normal user :
// Username: 1002528733
// Employee # and Name: 221142 - فؤاد محمدامين بكر موسى
// moe123456
//
//
// 3) HR User Account
// Username: 1087779144
// Employee # and Name: 190089 - عبدالله عبدالرحمن محمد الشهري
// Password: moe123456
} }
if (isAppOpenBySystem!) checkFirebaseToken(); if (isAppOpenBySystem!) checkFirebaseToken();
} }
@ -232,7 +239,7 @@ class _LoginScreenState extends State<LoginScreen> {
12.height, 12.height,
InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true), InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true),
9.height, 9.height,
if (env["login"]["forgetPassword"]) if (env.login.forgetPassword)
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() { child: LocaleKeys.forgotPassword.tr().toText12(isUnderLine: true, color: MyColors.textMixColor).onPress(() {

@ -11,6 +11,7 @@ import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/date_uitl.dart'; import 'package:mohem_flutter_app/classes/date_uitl.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart'; import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
@ -141,7 +142,7 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
children: [ children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
getButton(2), if (env.login.verificationMethod.whatsapp) getButton(2),
getButton(1), getButton(1),
], ],
) )

@ -79,7 +79,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
children: [ children: [
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(3),
if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4), if (!isNeedVerifyWithFaceIDAndBiometrics) getButton(4),
if (env["login"]["verificationMethod"]["whatsapp"]) getButton(2), if (env.login.verificationMethod.whatsapp) getButton(2),
getButton(1), getButton(1),
], ],
) )
@ -620,7 +620,7 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""), int.tryParse(AppState().memberLoginList?.pMOBILENUMBER ?? ""),
(value, TextEditingController _pinPutController) async { (value, TextEditingController _pinPutController) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(true, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName);
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW(
AppState().memberLoginList?.pEMAILADDRESS ?? "", AppState().memberLoginList?.pEMAILADDRESS ?? "",
@ -638,13 +638,13 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first; AppState().setMemberInformationListModel = genericResponseModel.memberInformationList?.first;
MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []); MemberInformationListModel.saveToPrefs(genericResponseModel.memberInformationList ?? []);
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []); PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID; // AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; // AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword; // AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!); Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!); Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!); // Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID ?? "");
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!); // Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiPassword, genericResponseModel.mohemmWifiPassword!);
} }
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context); Navigator.pop(context);

@ -5,6 +5,7 @@ import 'package:mohem_flutter_app/api/profile_api_client.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart'; import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/env.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -100,6 +101,7 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeePhonesList.length), itemCount: getEmployeePhonesList.length),
if(env.canEdit)
if (menuEntriesPhone.updateButton == 'Y') if (menuEntriesPhone.updateButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(
@ -131,6 +133,7 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
separatorBuilder: (cxt, index) => 12.height, separatorBuilder: (cxt, index) => 12.height,
itemCount: getEmployeeAddressList.length), itemCount: getEmployeeAddressList.length),
if(env.canEdit)
if (menuEntriesAddress.updateButton == 'Y') if (menuEntriesAddress.updateButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(
@ -148,6 +151,7 @@ class _ContactDetailsState extends State<ContactDetails> {
else else
Stack( Stack(
children: [ children: [
if(env.canEdit)
if (menuEntriesAddress.addButton == 'Y') if (menuEntriesAddress.addButton == 'Y')
AppState().isArabic(context) AppState().isArabic(context)
? Positioned( ? Positioned(

@ -29,7 +29,7 @@ class ProfileInFo extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
16.height, 16.height,
memberInfo.eMPLOYEENAME!.toText22(), memberInfo.eMPLOYEENAME!.toText22(isCentered: true),
("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color), ("${memberInfo.eMPLOYEENUMBER!} | ${memberInfo.getPositionName()}").toText13(color: MyColors.grey80Color),
memberInfo.eMPLOYEEEMAILADDRESS!.toText13(), memberInfo.eMPLOYEEEMAILADDRESS!.toText13(),
12.height, 12.height,

@ -13,7 +13,7 @@ class AppLogo extends StatelessWidget {
return Row( return Row(
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/mohemm_logo.svg", "assets/moe_logo.svg",
height: 48, height: 48,
width: 48, width: 48,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,

@ -36,7 +36,7 @@ class _LoadingDialogState extends State<LoadingDialog> {
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
child: Center( child: Center(
child: Image.asset( child: Image.asset(
"assets/images/logos/loading_mohemm_logo.gif", "assets/images/logos/loading_moe.gif",
height: 96.0, height: 96.0,
width: 96.0, width: 96.0,
), ),

Loading…
Cancel
Save