bug fixes

merge-requests/14/head
Sultan khan 3 years ago
parent 90d9cc04fc
commit 398880c4ad

@ -1,7 +1,7 @@
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://hmgwebservices.com"; // Live 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 baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -60,13 +60,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isAttendanceTrackingLoading = false; isAttendanceTrackingLoading = false;
// isTimeRemainingInSeconds = calculateSeconds( "00:00:00"); // isTimeRemainingInSeconds = calculateSeconds( "00:00:00");
if (attendanceTracking?.pSwipeIn != null) { if (attendanceTracking?.pSwipeIn != null) {
isTimeRemainingInSeconds = isTimeRemainingInSeconds = calculateSeconds(attendanceTracking!.pRemainingHours ?? "00:00:00");
calculateSeconds(attendanceTracking!.pRemainingHours ?? "00:00:00"); int totalShiftTimeInSeconds = calculateSeconds(attendanceTracking!.pScheduledHours ?? "00:00:00");
int totalShiftTimeInSeconds =
calculateSeconds(attendanceTracking!.pScheduledHours ?? "00:00:00");
progress = (isTimeRemainingInSeconds / totalShiftTimeInSeconds); progress = (isTimeRemainingInSeconds / totalShiftTimeInSeconds);
endTime = DateTime.now().millisecondsSinceEpoch + endTime = DateTime.now().millisecondsSinceEpoch + Duration(seconds: isTimeRemainingInSeconds).inMilliseconds;
Duration(seconds: isTimeRemainingInSeconds).inMilliseconds;
} }
notifyListeners(); notifyListeners();
@ -100,6 +97,14 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
isOffersLoading = true; isOffersLoading = true;
getOffersList = []; getOffersList = [];
drawerMenuItemList = [
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/mowadhafi.svg", LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg", LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
DrawerMenuItem("assets/images/drawer/change_password.svg", LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];
notifyListeners(); notifyListeners();
} }
@ -122,8 +127,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
Future fetchWorkListCounter(context, {bool showLoading = false}) async { Future fetchWorkListCounter(context, {bool showLoading = false}) async {
try { try {
if (showLoading) Utils.showLoading(context); if (showLoading) Utils.showLoading(context);
GenericResponseModel? genericResponseModel = GenericResponseModel? genericResponseModel = await DashboardApiClient().getOpenNotifications();
await DashboardApiClient().getOpenNotifications();
isWorkListLoading = false; isWorkListLoading = false;
getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList; getOpenNotificationsList = genericResponseModel?.getOpenNotificationsList;
@ -132,14 +136,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
itgFormsModel = await DashboardApiClient().getItgFormsPendingTask(); itgFormsModel = await DashboardApiClient().getItgFormsPendingTask();
workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0); workListCounter = workListCounter + (itgFormsModel?.totalCount ?? 0);
GenericResponseModel? cocGenericResponseModel = GenericResponseModel? cocGenericResponseModel = await DashboardApiClient().getCOCNotifications();
await DashboardApiClient().getCOCNotifications();
cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem; cocCount = cocGenericResponseModel?.mohemmITGPendingTaskResponseItem;
if (cocCount != null) { if (cocCount != null) {
cocFinalCount = (cocCount?.escalation ?? 0) + cocFinalCount = (cocCount?.escalation ?? 0) + (cocCount?.waitingToClose ?? 0) + (cocCount?.waitingForAcceptance ?? 0) + (cocCount?.extendTATRequest ?? 0);
(cocCount?.waitingToClose ?? 0) +
(cocCount?.waitingForAcceptance ?? 0) +
(cocCount?.extendTATRequest ?? 0);
workListCounter += cocFinalCount; workListCounter += cocFinalCount;
} }
if (showLoading) Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
@ -156,12 +156,9 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//Missing Siwpe API's & Methods //Missing Siwpe API's & Methods
Future fetchMissingSwipe(context) async { Future fetchMissingSwipe(context) async {
try { try {
GenericResponseModel? genericResponseModel = GenericResponseModel? genericResponseModel = await DashboardApiClient().getOpenMissingSwipes();
await DashboardApiClient().getOpenMissingSwipes();
isMissingSwipeLoading = false; isMissingSwipeLoading = false;
missingSwipeCounter = missingSwipeCounter = genericResponseModel!.getOpenMissingSwipesList!.pOpenMissingSwipes ?? 0;
genericResponseModel!.getOpenMissingSwipesList!.pOpenMissingSwipes ??
0;
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isMissingSwipeLoading = false; isMissingSwipeLoading = false;
@ -174,12 +171,10 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//Leave and Ticket Balance API's & Methods //Leave and Ticket Balance API's & Methods
Future fetchLeaveTicketBalance(context, DateTime date) async { Future fetchLeaveTicketBalance(context, DateTime date) async {
try { try {
accrualList = await DashboardApiClient() accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date));
.getAccrualBalances(DateFormat("MM/dd/yyyy").format(date));
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList![0]; leaveBalanceAccrual = accrualList![0];
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0);
(accrualList![2].accrualNetEntitlement ?? 0.0);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
@ -191,37 +186,18 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//List Menu API's & Methods //List Menu API's & Methods
List<DrawerMenuItem> drawerMenuItemList = [ List<DrawerMenuItem> drawerMenuItemList = [];
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/mowadhafi.svg",
LocaleKeys.mowadhafhi.tr(), AppRoutes.mowadhafhi),
DrawerMenuItem("assets/images/drawer/pending_trasactions.svg",
LocaleKeys.pendingTransactions.tr(), AppRoutes.pendingTransactions),
DrawerMenuItem("assets/images/drawer/change_password.svg",
LocaleKeys.changePassword.tr(), AppRoutes.changePassword),
];
void fetchListMenu() async { void fetchListMenu() async {
try { try {
List<ListMenu> menuList = await DashboardApiClient().getListMenu(); List<ListMenu> menuList = await DashboardApiClient().getListMenu();
List findMyRequest = List findMyRequest = menuList.where((element) => element.menuType == "E").toList();
menuList.where((element) => element.menuType == "E").toList();
if (findMyRequest.isNotEmpty) { if (findMyRequest.isNotEmpty) {
drawerMenuItemList.insert( drawerMenuItemList.insert(3, DrawerMenuItem("assets/images/drawer/my_requests.svg", LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
3,
DrawerMenuItem("assets/images/drawer/my_requests.svg",
LocaleKeys.myRequest.tr(), AppRoutes.myRequests));
} }
List findMyTeam = List findMyTeam = menuList.where((element) => element.menuType == "M").toList();
menuList.where((element) => element.menuType == "M").toList();
if (findMyTeam.isNotEmpty) { if (findMyTeam.isNotEmpty) {
drawerMenuItemList.insert( drawerMenuItemList.insert(2, DrawerMenuItem("assets/images/drawer/my_team.svg", LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
2,
DrawerMenuItem("assets/images/drawer/my_team.svg",
LocaleKeys.myTeamMembers.tr(), AppRoutes.myTeam));
} }
} catch (ex) { } catch (ex) {
logger.wtf(ex); logger.wtf(ex);
@ -232,19 +208,12 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
//Menu Entries API's & Methods //Menu Entries API's & Methods
void fetchMenuEntries() async { void fetchMenuEntries() async {
try { try {
GenericResponseModel? genericResponseModel = GenericResponseModel? genericResponseModel = await DashboardApiClient().getGetMenuEntries();
await DashboardApiClient().getGetMenuEntries();
getMenuEntriesList = genericResponseModel!.getMenuEntriesList; getMenuEntriesList = genericResponseModel!.getMenuEntriesList;
homeMenus = parseMenus(getMenuEntriesList ?? []); homeMenus = parseMenus(getMenuEntriesList ?? []);
if (homeMenus!.isNotEmpty) { if (homeMenus!.isNotEmpty) {
homeMenus!.first.menuEntiesList.insert( homeMenus!.first.menuEntiesList.insert(0, GetMenuEntriesList(requestType: "MONTHLY_ATTENDANCE", prompt: LocaleKeys.monthlyAttendance.tr()));
0, homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(requestType: "VACATION_RULE", prompt: LocaleKeys.vacationRule.tr()));
GetMenuEntriesList(
requestType: "MONTHLY_ATTENDANCE",
prompt: LocaleKeys.monthlyAttendance.tr()));
homeMenus!.first.menuEntiesList.add(GetMenuEntriesList(
requestType: "VACATION_RULE",
prompt: LocaleKeys.vacationRule.tr()));
} }
isServicesMenusLoading = false; isServicesMenusLoading = false;
notifyListeners(); notifyListeners();
@ -272,12 +241,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
List<Menus> menus = []; List<Menus> menus = [];
for (int i = 0; i < getMenuEntriesList.length; i++) { for (int i = 0; i < getMenuEntriesList.length; i++) {
if (getMenuEntriesList[i].parentMenuName!.isEmpty) { if (getMenuEntriesList[i].parentMenuName!.isEmpty) {
menus.add(Menus( menus.add(Menus(getMenuEntriesList[i], getMenuEntriesList.where((element) => getMenuEntriesList[i].menuName == element.parentMenuName).toList()));
getMenuEntriesList[i],
getMenuEntriesList
.where((element) =>
getMenuEntriesList[i].menuName == element.parentMenuName)
.toList()));
} }
} }
return menus; return menus;

@ -38,7 +38,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data; late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey(); final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController = RefreshController(initialRefresh: false); final RefreshController _refreshController =
RefreshController(initialRefresh: false);
int currentIndex = 0; int currentIndex = 0;
@ -106,7 +107,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState.currentState!.openDrawer(); _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,
SizedBox( SizedBox(
width: 36, width: 36,
height: 36, height: 36,
@ -119,7 +122,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
top: 0, top: 0,
child: Container( child: Container(
padding: const EdgeInsets.only(left: 5, right: 5), padding: const EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), decoration: BoxDecoration(
color: MyColors.redColor,
borderRadius: BorderRadius.circular(17)),
child: "3".toText12(color: Colors.white), child: "3".toText12(color: Colors.white),
), ),
) )
@ -134,7 +139,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
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: _onRefresh,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -143,8 +150,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), LocaleKeys.goodMorning
(AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true), .tr()
.toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "")
.toText24(isBold: true),
16.height, 16.height,
Row( Row(
children: [ children: [
@ -154,99 +164,210 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Consumer<DashboardProviderModel>( child: Consumer<DashboardProviderModel>(
builder: (context, model, child) { builder: (context, model, child) {
return (model.isAttendanceTrackingLoading return (model.isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer() ? GetAttendanceTrackingShimmer()
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius:
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ BorderRadius.circular(15),
MyColors.gradiantEndColor, gradient:
MyColors.gradiantStartColor, const LinearGradient(
]), transform:
), GradientRotation(
child: Stack( .46),
alignment: Alignment.center, begin: Alignment
children: [ .topRight,
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"), end: Alignment
Column( .bottomLeft,
crossAxisAlignment: CrossAxisAlignment.start, colors: [
children: [ MyColors
Expanded( .gradiantEndColor,
child: Column( MyColors
mainAxisSize: MainAxisSize.min, .gradiantStartColor,
crossAxisAlignment: CrossAxisAlignment.start, ]),
),
child: Stack(
alignment: Alignment.center,
children: [ children: [
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), if (model
if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white), .isTimeRemainingInSeconds ==
if (model.isTimeRemainingInSeconds != 0) 0)
Column( SvgPicture.asset(
mainAxisSize: MainAxisSize.min, "assets/images/thumb.svg"),
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment:
9.height, CrossAxisAlignment
CountdownTimer( .start,
endTime: model.endTime,
onEnd: null,
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
),
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
9.height,
ClipRRect(
borderRadius: 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: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.checkIn.tr().toText12(color: Colors.white), Expanded(
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn) child: Column(
.toString() mainAxisSize:
.toText14(color: Colors.white, isBold: true), MainAxisSize
4.height, .min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
LocaleKeys
.markAttendance
.tr()
.toText14(
color: Colors
.white,
isBold:
true),
if (model
.isTimeRemainingInSeconds ==
0)
"01-02-2022".toText12(
color: Colors
.white),
if (model
.isTimeRemainingInSeconds !=
0)
Column(
mainAxisSize:
MainAxisSize
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
9.height,
CountdownTimer(
endTime: model
.endTime,
onEnd:
null,
endWidget: "00:00:00".toText14(
color: Colors
.white,
isBold:
true),
textStyle: TextStyle(
color: Colors
.white,
fontSize:
14,
letterSpacing:
-0.48,
fontWeight:
FontWeight.bold),
),
LocaleKeys
.timeLeftToday
.tr()
.toText12(
color:
Colors.white),
9.height,
ClipRRect(
borderRadius:
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: [
Expanded(
child: 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),
4.height,
],
).paddingOnly(
left: 12),
),
Container(
width: 45,
height: 45,
padding:
const EdgeInsets
.only(
left: 14,
right:
14),
decoration:
const BoxDecoration(
color: Color(
0xff259EA4),
borderRadius:
BorderRadius
.only(
bottomRight: Radius
.circular(
15),
),
),
child: SvgPicture.asset(
model.isTimeRemainingInSeconds ==
0
? "assets/images/play.svg"
: "assets/images/stop.svg"),
).onPress(() {
showMyBottomSheet(
context,
child:
MarkAttendanceWidget(
model));
}),
],
),
], ],
).paddingOnly(left: 12),
),
Container(
width: 45,
height: 45,
padding: const EdgeInsets.only(left: 14, right: 14),
decoration: const BoxDecoration(
color: Color(0xff259EA4),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(15),
),
), ),
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"), ],
).onPress(() { ),
showMyBottomSheet(context, child: MarkAttendanceWidget(model)); ).onPress(
}), () {
], Navigator.pushNamed(
), context,
], AppRoutes
), .todayAttendance);
], },
), ))
).onPress(
() {
Navigator.pushNamed(context, AppRoutes.todayAttendance);
},
))
.animatedSwither(); .animatedSwither();
}, },
), ),
@ -267,8 +388,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets.only(top: 31), padding: const EdgeInsets.only(top: 31),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), borderRadius: const BorderRadius.only(
border: Border.all(color: MyColors.lightGreyEDColor, width: 1), topRight: Radius.circular(50),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -284,22 +408,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
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( decoration: BoxDecoration(
color: MyColors.yellowColor, color: MyColors.yellowColor,
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(10),
), ),
child: LocaleKeys.newString.tr().toText10(isBold: true)), child: LocaleKeys.newString
.tr()
.toText10(isBold: true)),
], ],
), ),
], ],
), ),
), ),
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() { LocaleKeys.viewAllOffers
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts); .tr()
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
}) })
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
@ -310,53 +444,86 @@ class _DashboardScreenState extends State<DashboardScreen> {
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: (cxt, index) { itemBuilder: (cxt, 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( },
width: 73, child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 73, width: 73,
height: 73, child: Column(
decoration: BoxDecoration( crossAxisAlignment:
borderRadius: const BorderRadius.all( CrossAxisAlignment.center,
Radius.circular(100), children: [
), Container(
border: Border.all(color: MyColors.lightGreyE3Color, width: 1), width: 73,
), height: 73,
child: ClipRRect( decoration: BoxDecoration(
borderRadius: const BorderRadius.all( borderRadius:
Radius.circular(50), const BorderRadius
), .all(
child: Hero( Radius.circular(100),
tag: "ItemImage" + data.getOffersList[index].rowID!, ),
transitionOnUserGestures: true, border: Border.all(
child: Image.network( color: MyColors
data.getOffersList[index].bannerImage!, .lightGreyE3Color,
fit: BoxFit.contain, width: 1),
),
child: ClipRRect(
borderRadius:
const BorderRadius
.all(
Radius.circular(50),
),
child: Hero(
tag: "ItemImage" +
data
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
child: Image.network(
data
.getOffersList[
index]
.bannerImage!,
fit: BoxFit.contain,
),
),
),
), ),
), 4.height,
Expanded(
child: AppState()
.isArabic(context)
? data
.getOffersList[
index]
.titleAR!
.toText12(
isCenter:
true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter:
true,
maxLine: 1),
),
],
), ),
), ),
4.height, );
Expanded(
child: AppState().isArabic(context)
? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
: data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
),
],
),
),
);
}, },
separatorBuilder: (cxt, index) => 8.width, separatorBuilder: (cxt, index) => 8.width,
itemCount: 6), itemCount: 6),
@ -383,14 +550,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
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.createRequest.tr(), label: LocaleKeys.createRequest.tr(),
), ),
@ -400,7 +571,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
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: (cxt, data, child) { builder: (cxt, data, child) {
@ -413,8 +586,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
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(
child: data.workListCounter.toString().toText10(color: Colors.white), color: MyColors.redColor,
borderRadius: BorderRadius.circular(17)),
child: data.workListCounter
.toString()
.toText10(color: Colors.white),
), ),
); );
}, },
@ -426,19 +603,29 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/item_for_sale.svg", "assets/icons/item_for_sale.svg",
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color, color: currentIndex == 3
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(), label: LocaleKeys.itemsForSale.tr(),
), ),
], ],
currentIndex: currentIndex, currentIndex: currentIndex,
selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600), selectedLabelStyle: const TextStyle(
unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600), fontSize: 10,
color: MyColors.grey3AColor,
fontWeight: FontWeight.w600),
unselectedLabelStyle: const TextStyle(
fontSize: 10,
color: MyColors.grey98Color,
fontWeight: FontWeight.w600),
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.grey3AColor, selectedItemColor: MyColors.grey3AColor,
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28), selectedIconTheme:
unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28), const IconThemeData(color: MyColors.grey3AColor, size: 28),
unselectedIconTheme:
const IconThemeData(color: MyColors.grey98Color, size: 28),
onTap: (int index) { onTap: (int index) {
if (index == 1) { if (index == 1) {
Navigator.pushNamed(context, AppRoutes.mowadhafhi); Navigator.pushNamed(context, AppRoutes.mowadhafhi);
@ -469,6 +656,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
}); });
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList); Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails,
arguments: getOffersDetailList);
} }
} }

@ -57,21 +57,30 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments as GetMobileLoginInfoListModel; mobileLoginInfoListModel ??= ModalRoute.of(context)!.settings.arguments
String empName = AppState().isArabic(context) ? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr! : AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!; as GetMobileLoginInfoListModel;
String empName = AppState().isArabic(context)
? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr!
: AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn!;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false) title: (mobileLoginInfoListModel?.businessCardPrivilege ?? false)
? LocaleKeys.viewBusinessCard.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { ? LocaleKeys.viewBusinessCard
.tr()
.toText12(color: MyColors.textMixColor, isUnderLine: true)
.onPress(() {
showMDialog(context, child: BusinessCardDialog()); showMDialog(context, child: BusinessCardDialog());
}) })
: null, : null,
actions: [ actions: [
Center( Center(
child: LocaleKeys.employeeDigitalID.tr().toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() { child: LocaleKeys.employeeDigitalID
.tr()
.toText12(color: MyColors.textMixColor, isUnderLine: true)
.onPress(() {
showMDialog(context, child: EmployeeDigitialIdDialog()); showMDialog(context, child: EmployeeDigitialIdDialog());
})), })),
21.width 21.width
@ -90,9 +99,12 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.welcomeBack.tr().toText12(), LocaleKeys.welcomeBack.tr().toText12(),
mobileLoginInfoListModel!.employeeName!.toText24(isBold: true), mobileLoginInfoListModel!.employeeName!
.toText24(isBold: true),
10.height, 10.height,
LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(), LocaleKeys.wouldYouLikeToLoginWithCurrentUsername
.tr()
.toText16(),
Container( Container(
height: 72, height: 72,
margin: const EdgeInsets.only(top: 23, bottom: 23), margin: const EdgeInsets.only(top: 23, bottom: 23),
@ -114,26 +126,42 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
LocaleKeys.lastLoginDetails.tr().toText16(), LocaleKeys.lastLoginDetails.tr().toText16(),
DateUtil.formatDateToDate(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!), false).toText12(), DateUtil.formatDateToDate(
DateUtil.convertStringToDate(
mobileLoginInfoListModel!.editedOn!),
false)
.toText12(),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color), LocaleKeys.verificationType
getVerificationType(mobileLoginInfoListModel!.loginType!).toText12(), .tr()
.toText10(color: MyColors.grey57Color),
getVerificationType(
mobileLoginInfoListModel!.loginType!)
.toText12(),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(mobileLoginInfoListModel!.editedOn!)).toText12(), DateUtil.formatDateToTime(
DateUtil.convertStringToDate(
mobileLoginInfoListModel!.editedOn!))
.toText12(),
], ],
) )
], ],
), ),
), ),
LocaleKeys.pleaseVerify.tr().toText16(), LocaleKeys.pleaseVerify.tr().toText16(),
if (isNeedVerifyWithFaceIDAndBiometrics) LocaleKeys.pleaseVerifyForBio.tr().toText12(), if (isNeedVerifyWithFaceIDAndBiometrics)
LocaleKeys.pleaseVerifyForBio.tr().toText12(),
GridView( GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 9), padding: const EdgeInsets.only(top: 9),
shrinkWrap: true, shrinkWrap: true,
@ -186,7 +214,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
DefaultButton( DefaultButton(
LocaleKeys.useAnotherAccount.tr(), LocaleKeys.useAnotherAccount.tr(),
() { () {
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.login, (Route<dynamic> route) => false, arguments: false); Navigator.pushNamedAndRemoveUntil(
context, AppRoutes.login, (Route<dynamic> route) => false,
arguments: false);
}, },
).insideContainer, ).insideContainer,
], ],
@ -218,11 +248,19 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
} }
Future<bool> loginWithFaceIDAndBiometrics() async { Future<bool> loginWithFaceIDAndBiometrics() async {
IOSAuthMessages iosStrings = IOSAuthMessages iosStrings = const IOSAuthMessages(
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID');
bool authenticated = false; bool authenticated = false;
try { try {
authenticated = await auth.authenticate(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, biometricOnly: true, iOSAuthStrings: iosStrings); authenticated = await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
biometricOnly: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) { } on PlatformException catch (e) {
print(e); print(e);
Utils.hideLoading(context); Utils.hideLoading(context);
@ -231,8 +269,11 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return authenticated; return authenticated;
} }
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { Widget _loginOptionButton(
bool isDisable = ((_flag == 3 && !checkBiometricIsAvailable(BiometricType.face)) || (_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint))); String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = ((_flag == 3 &&
!checkBiometricIsAvailable(BiometricType.face)) ||
(_flag == 4 && !checkBiometricIsAvailable(BiometricType.fingerprint)));
return InkWell( return InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -243,18 +284,21 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
}); });
} else { } else {
if (_flag == 3 || _flag == 4) { if (_flag == 3 || _flag == 4) {
bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); bool authenticateWithFaceAndTouchID =
await loginWithFaceIDAndBiometrics();
if (!authenticateWithFaceAndTouchID) { if (!authenticateWithFaceAndTouchID) {
return; return;
} else { } else {
if (mobileLoginInfoListModel!.loginType == 3 || mobileLoginInfoListModel!.loginType == 4) { if (mobileLoginInfoListModel!.loginType == 3 ||
mobileLoginInfoListModel!.loginType == 4) {
// bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics(); // bool authenticateWithFaceAndTouchID = await loginWithFaceIDAndBiometrics();
// if (!authenticateWithFaceAndTouchID) { // if (!authenticateWithFaceAndTouchID) {
// return; // return;
// } else { // } else {
// performApiCall(_title, _icon, _flag, isDirectLogin: true); // performApiCall(_title, _icon, _flag, isDirectLogin: true);
// } // }
performApiCall(_title, _icon, _flag, _flag, isDirectLogin: true); performApiCall(_title, _icon, _flag, _flag,
isDirectLogin: true);
} else { } else {
isNeedVerifyWithFaceIDAndBiometrics = true; isNeedVerifyWithFaceIDAndBiometrics = true;
selectedFlag = _flag; selectedFlag = _flag;
@ -272,7 +316,8 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
} }
}, },
child: Container( child: Container(
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), padding:
const EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: isDisable ? Colors.grey.withOpacity(0.3) : Colors.white, color: isDisable ? Colors.grey.withOpacity(0.3) : Colors.white,
@ -298,13 +343,23 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
Widget getButton(int flag) { Widget getButton(int flag) {
switch (flag) { switch (flag) {
case 1: case 1:
return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(), 'assets/images/login/verify_sms.svg', flag, null); return _loginOptionButton(LocaleKeys.verifyThroughSMS.tr(),
'assets/images/login/verify_sms.svg', flag, null);
case 2: case 2:
return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(), 'assets/images/login/verify_whatsapp.svg', flag, null); return _loginOptionButton(LocaleKeys.verifyThroughWhatsapp.tr(),
'assets/images/login/verify_whatsapp.svg', flag, null);
case 3: case 3:
return _loginOptionButton(LocaleKeys.verifyThroughFace.tr(), 'assets/images/login/verify_face.svg', flag, BiometricType.face.index); return _loginOptionButton(
LocaleKeys.verifyThroughFace.tr(),
'assets/images/login/verify_face.svg',
flag,
BiometricType.face.index);
case 4: case 4:
return _loginOptionButton(LocaleKeys.verifyThroughFingerprint.tr(), 'assets/images/login/verify_thumb.svg', flag, BiometricType.fingerprint.index); return _loginOptionButton(
LocaleKeys.verifyThroughFingerprint.tr(),
'assets/images/login/verify_thumb.svg',
flag,
BiometricType.fingerprint.index);
default: default:
return const SizedBox(); return const SizedBox();
} }
@ -321,7 +376,9 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
return isAvailable; return isAvailable;
} }
Future<void> performApiCall(String _title, String _icon, int _flag, int sendVerificationFlat, {bool isDirectLogin = false}) async { Future<void> performApiCall(
String _title, String _icon, int _flag, int sendVerificationFlat,
{bool isDirectLogin = false}) async {
try { try {
if (isDirectLogin) if (isDirectLogin)
setState(() { setState(() {
@ -330,10 +387,16 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
else else
Utils.showLoading(context); Utils.showLoading(context);
await LoginApiClient().checkMobileAppVersion(); await LoginApiClient().checkMobileAppVersion();
await LoginApiClient().memberLogin(AppState().getUserName!, AppState().password!); await LoginApiClient()
.memberLogin(AppState().getUserName!, AppState().password!);
if (!isDirectLogin) if (!isDirectLogin)
BasicMemberInformationModel? memberInformationModel = BasicMemberInformationModel? memberInformationModel =
await LoginApiClient().mohemmSendActivationCodeByOTPNotificationType(0, AppState().memberLoginList?.pMOBILENUMBER, sendVerificationFlat, AppState().getUserName); await LoginApiClient()
.mohemmSendActivationCodeByOTPNotificationType(
0,
AppState().memberLoginList?.pMOBILENUMBER,
sendVerificationFlat,
AppState().getUserName);
if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, ""); if (isDirectLogin) performDirectApiCall(_title, _icon, _flag, "");
if (!isDirectLogin) Utils.hideLoading(context); if (!isDirectLogin) Utils.hideLoading(context);
if (!isDirectLogin) if (!isDirectLogin)
@ -355,25 +418,34 @@ class _VerifyLastLoginScreenState extends State<VerifyLastLoginScreen> {
} }
} }
Future<void> performDirectApiCall(String _title, String _icon, int _flag, String value, {bool isDirectLogin = false}) async { Future<void> performDirectApiCall(
String _title, String _icon, int _flag, String value,
{bool isDirectLogin = false}) async {
try { try {
GenericResponseModel? genericResponseModel = await LoginApiClient().checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER, value, AppState().getUserName); GenericResponseModel? genericResponseModel = await LoginApiClient()
GenericResponseModel? genericResponseModel1 = await LoginApiClient().insertMobileLoginInfoNEW( .checkActivationCode(false, AppState().memberLoginList?.pMOBILENUMBER,
AppState().memberLoginList?.pEMAILADDRESS ?? "", value, AppState().getUserName);
genericResponseModel?.pSESSIONID ?? 0, GenericResponseModel? genericResponseModel1 = await LoginApiClient()
genericResponseModel?.memberInformationList![0].eMPLOYEENAME ?? "", .insertMobileLoginInfoNEW(
_flag, AppState().memberLoginList?.pEMAILADDRESS ?? "",
AppState().memberLoginList?.pMOBILENUMBER ?? "", genericResponseModel?.pSESSIONID ?? 0,
AppState().getUserName!, genericResponseModel?.memberInformationList![0].eMPLOYEENAME ??
mobileLoginInfoListModel!.deviceToken!, "",
Platform.isAndroid ? "android" : "ios"); _flag,
AppState().memberLoginList?.pMOBILENUMBER ?? "",
AppState().getUserName!,
mobileLoginInfoListModel!.deviceToken!,
Platform.isAndroid ? "android" : "ios");
AppState().setMemberInformationListModel =
genericResponseModel!.memberInformationList?.first;
if (genericResponseModel?.errorMessage != null) { if (genericResponseModel?.errorMessage != null) {
Utils.showToast(genericResponseModel?.errorMessage ?? ""); Utils.showToast(genericResponseModel?.errorMessage ?? "");
// Navigator.pop(context); // Navigator.pop(context);
} }
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context); Navigator.pop(context);
Navigator.pushNamedAndRemoveUntil(context, AppRoutes.dashboard, (Route<dynamic> route) => false); Navigator.pushNamedAndRemoveUntil(
context, AppRoutes.dashboard, (Route<dynamic> route) => false);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);

@ -67,17 +67,23 @@ class _MyTeamState extends State<MyTeam> {
Row( Row(
children: [ children: [
TextField( TextField(
onChanged: dropdownValue == "name" onChanged: dropdownValue.toLowerCase() == "name"
? (String value) { ? (String value) {
getEmployeeSListOnSearch = getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList(); getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {}); setState(() {});
} }
: (String value) { : dropdownValue.toLowerCase() == "username"
getEmployeeSListOnSearch = ? (String value) {
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList(); getEmployeeSListOnSearch =
setState(() {}); getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENUMBER!.toLowerCase().contains(value.toLowerCase())).toList();
}, setState(() {});
}
: (String value) {
getEmployeeSListOnSearch =
getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEEEMAILADDRESS!.toLowerCase().contains(value.toLowerCase())).toList();
setState(() {});
},
style: const TextStyle( style: const TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: MyColors.grey3AColor, color: MyColors.grey3AColor,
@ -113,9 +119,9 @@ class _MyTeamState extends State<MyTeam> {
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 12), padding: const EdgeInsets.only(top: 12),
separatorBuilder: (BuildContext cxt,int index) => 12.height, separatorBuilder: (BuildContext cxt, int index) => 12.height,
itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length, itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length,
itemBuilder: (BuildContext cxt,int index) { itemBuilder: (BuildContext cxt, int index) {
var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}'); var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}');
return InkWell( return InkWell(
onTap: () async { onTap: () async {
@ -177,7 +183,7 @@ class _MyTeamState extends State<MyTeam> {
} }
// todo @fatima add translation for below list // todo @fatima add translation for below list
List<String> list = [LocaleKeys.name.tr(), LocaleKeys.email.tr()]; List<String> list = [LocaleKeys.name.tr(), LocaleKeys.email.tr(), LocaleKeys.username.tr()];
Widget dropDown() { Widget dropDown() {
return PopupMenuButton( return PopupMenuButton(
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[

@ -67,11 +67,17 @@ class _DynamicInputScreenState extends State<DynamicInputScreenProfile> {
getBasicDetColsStructureList = genericResponseModel?.getBasicDetColsStructureList ?? []; getBasicDetColsStructureList = genericResponseModel?.getBasicDetColsStructureList ?? [];
if (dynamicParams!.correctOrNew == 1) { if (dynamicParams!.correctOrNew == 1) {
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((GetBasicDetDffStructureList element) {
element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME); element.userBasicDetail =
dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((GetEmployeeBasicDetailsList userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
}); });
getBasicDetColsStructureList?.forEach((element) { getBasicDetColsStructureList?.forEach((GetBasicDetColsStructureList element) {
element.userBasicDetail = dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME); element.userBasicDetail =
dynamicParams!.getEmployeeBasicDetailsList!.singleWhere((GetEmployeeBasicDetailsList userDetail) => userDetail.aPPLICATIONCOLUMNNAME == element.aPPLICATIONCOLUMNNAME);
if (element.objectValuesList != null) {
ObjectValuesList dropDownListValue = element.objectValuesList!.singleWhere((ObjectValuesList dropdown) => dropdown.cODE == element.userBasicDetail!.vARCHAR2VALUE);
element.userBasicDetail!.sEGMENTVALUEDSP = dropDownListValue.mEANING;
}
}); });
} else { } else {
getBasicDetDffStructureList?.forEach((element) { getBasicDetDffStructureList?.forEach((element) {

Loading…
Cancel
Save