worklist improvements

faiz_marathon_signalR_critical
Sikander Saleem 2 years ago
parent 91abaa8475
commit d26b7e0753

@ -46,7 +46,7 @@ class MyColors {
static const Color grey3AColor = Color(0xff2E303A); static const Color grey3AColor = Color(0xff2E303A);
static const Color darkColor = Color(0xff000015); static const Color darkColor = Color(0xff000015);
static const Color lightGrayColor = Color(0xff808080); static const Color lightGrayColor = Color(0xff808080);
static const Color DarkRedColor = Color(0xffD02127); static const Color darkRedColor = Color(0xffD02127);
static const Color lightGreyColor = Color(0xffC7C7C7); static const Color lightGreyColor = Color(0xffC7C7C7);
static const Color green69Color = Color(0xff1FA169); static const Color green69Color = Color(0xff1FA169);
static const Color redA3Color = Color(0xffCA3332); static const Color redA3Color = Color(0xffCA3332);

@ -38,8 +38,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data; late DashboardProviderModel data;
final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey(); final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
final RefreshController _refreshController = final RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController(initialRefresh: false);
int currentIndex = 0; int currentIndex = 0;
@ -107,29 +106,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState.currentState!.openDrawer(); _scaffoldState.currentState!.openDrawer();
}); });
}), }),
Image.asset("assets/images/logos/main_mohemm_logo.png", Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
width: 134, height: 28) SvgPicture.asset(
.expanded, "assets/images/announcements.svg",
SizedBox(
width: 36,
height: 36,
child: Stack(
alignment: Alignment.centerLeft,
children: [
SvgPicture.asset("assets/images/announcements.svg"),
Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 5, right: 5),
decoration: BoxDecoration(
color: MyColors.redColor,
borderRadius: BorderRadius.circular(17)),
child: "3".toText12(color: Colors.white),
),
)
],
),
).onPress(() async { ).onPress(() async {
await Navigator.pushNamed(context, AppRoutes.announcements); await Navigator.pushNamed(context, AppRoutes.announcements);
}) })
@ -150,11 +129,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.goodMorning LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color),
.tr() (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
.toText14(color: MyColors.grey77Color),
(AppState().memberInformationList!.eMPLOYEENAME ?? "")
.toText24(isBold: true),
16.height, 16.height,
Row( Row(
children: [ children: [
@ -167,192 +143,84 @@ class _DashboardScreenState extends State<DashboardScreen> {
? GetAttendanceTrackingShimmer() ? GetAttendanceTrackingShimmer()
: Container( : Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(15),
BorderRadius.circular(15), gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
gradient: MyColors.gradiantEndColor,
const LinearGradient( MyColors.gradiantStartColor,
transform:
GradientRotation(
.46),
begin: Alignment
.topRight,
end: Alignment
.bottomLeft,
colors: [
MyColors
.gradiantEndColor,
MyColors
.gradiantStartColor,
]), ]),
), ),
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
if (model if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
.isTimeRemainingInSeconds ==
0)
SvgPicture.asset(
"assets/images/thumb.svg"),
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
LocaleKeys LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
.markAttendance if (model.isTimeRemainingInSeconds == 0) "01-02-2022".toText12(color: Colors.white),
.tr() if (model.isTimeRemainingInSeconds != 0)
.toText14(
color: Colors
.white,
isBold:
true),
if (model
.isTimeRemainingInSeconds ==
0)
"01-02-2022".toText12(
color: Colors
.white),
if (model
.isTimeRemainingInSeconds !=
0)
Column( Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
9.height, 9.height,
CountdownTimer( CountdownTimer(
endTime: model endTime: model.endTime,
.endTime, onEnd: null,
onEnd: endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
null, textStyle: TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
endWidget: "00:00:00".toText14( ),
color: Colors LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
.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, 9.height,
ClipRRect( ClipRRect(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius Radius.circular(20),
.all( ),
Radius.circular( child: LinearProgressIndicator(
20), value: model.progress,
), minHeight: 8,
child: valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
LinearProgressIndicator( backgroundColor: const Color(0xff196D73),
value: model
.progress,
minHeight:
8,
valueColor:
const AlwaysStoppedAnimation<Color>(Colors.white),
backgroundColor:
const Color(0xff196D73),
), ),
), ),
], ],
), ),
], ],
).paddingOnly( ).paddingOnly(top: 12, right: 15, left: 12),
top: 12,
right: 15,
left: 12),
), ),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: mainAxisSize: MainAxisSize.min,
MainAxisSize crossAxisAlignment: CrossAxisAlignment.start,
.min,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
LocaleKeys LocaleKeys.checkIn.tr().toText12(color: Colors.white),
.checkIn (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
.tr()
.toText12(
color:
Colors.white),
(model.attendanceTracking!.pSwipeIn ==
null
? "--:--"
: model
.attendanceTracking!
.pSwipeIn)
.toString() .toString()
.toText14( .toText14(color: Colors.white, isBold: true),
color: Colors
.white,
isBold:
true),
4.height, 4.height,
], ],
).paddingOnly( ).paddingOnly(left: 12),
left: 12),
), ),
Container( Container(
width: 45, width: 45,
height: 45, height: 45,
padding: padding: const EdgeInsets.only(left: 14, right: 14),
const EdgeInsets decoration: const BoxDecoration(
.only( color: Color(0xff259EA4),
left: 14, borderRadius: BorderRadius.only(
right: bottomRight: Radius.circular(15),
14), ),
decoration: ),
const BoxDecoration( child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/play.svg" : "assets/images/stop.svg"),
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(() { ).onPress(() {
showMyBottomSheet( showMyBottomSheet(context, child: MarkAttendanceWidget(model));
context,
child:
MarkAttendanceWidget(
model));
}), }),
], ],
), ),
@ -362,10 +230,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
).onPress( ).onPress(
() { () {
Navigator.pushNamed( Navigator.pushNamed(context, AppRoutes.todayAttendance);
context,
AppRoutes
.todayAttendance);
}, },
)) ))
.animatedSwither(); .animatedSwither();
@ -388,11 +253,8 @@ 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( borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
topRight: Radius.circular(50), border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
topLeft: Radius.circular(50)),
border: Border.all(
color: MyColors.lightGreyEDColor, width: 1),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -408,32 +270,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
LocaleKeys.offers.tr().toText12(), LocaleKeys.offers.tr().toText12(),
Row( Row(
children: [ children: [
LocaleKeys.discounts LocaleKeys.discounts.tr().toText24(isBold: true),
.tr()
.toText24(isBold: true),
6.width, 6.width,
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(left: 8, right: 8),
left: 8, right: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: MyColors.yellowColor, color: MyColors.yellowColor,
borderRadius: borderRadius: BorderRadius.circular(10),
BorderRadius.circular(10),
), ),
child: LocaleKeys.newString child: LocaleKeys.newString.tr().toText10(isBold: true)),
.tr()
.toText10(isBold: true)),
], ],
), ),
], ],
), ),
), ),
LocaleKeys.viewAllOffers LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
.tr() Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
.toText12(isUnderLine: true)
.onPress(() {
Navigator.pushNamed(
context, AppRoutes.offersAndDiscounts);
}) })
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
@ -444,56 +296,38 @@ 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( padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
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( navigateToDetails(data.getOffersList[index]);
data.getOffersList[index]);
}, },
child: SizedBox( child: SizedBox(
width: 73, width: 73,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: 73, width: 73,
height: 73, height: 73,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: const BorderRadius.all(
const BorderRadius
.all(
Radius.circular(100), Radius.circular(100),
), ),
border: Border.all( border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
color: MyColors
.lightGreyE3Color,
width: 1),
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: const BorderRadius.all(
const BorderRadius
.all(
Radius.circular(50), Radius.circular(50),
), ),
child: Hero( child: Hero(
tag: "ItemImage" + tag: "ItemImage" + data.getOffersList[index].rowID!,
data transitionOnUserGestures: true,
.getOffersList[
index]
.rowID!,
transitionOnUserGestures:
true,
child: Image.network( child: Image.network(
data data.getOffersList[index].bannerImage!,
.getOffersList[
index]
.bannerImage!,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
@ -501,24 +335,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
4.height, 4.height,
Expanded( Expanded(
child: AppState() child: AppState().isArabic(context)
.isArabic(context) ? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
? data : data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
.getOffersList[
index]
.titleAR!
.toText12(
isCenter:
true,
maxLine: 1)
: data
.getOffersList[
index]
.title!
.toText12(
isCenter:
true,
maxLine: 1),
), ),
], ],
), ),
@ -550,18 +369,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem( BottomNavigationBarItem(
icon: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/home.svg", "assets/icons/home.svg",
color: currentIndex == 0 color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
? 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 color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.createRequest.tr(), label: LocaleKeys.createRequest.tr(),
), ),
@ -571,9 +386,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/icons/work_list.svg", "assets/icons/work_list.svg",
color: currentIndex == 2 color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
Consumer<DashboardProviderModel>( Consumer<DashboardProviderModel>(
builder: (cxt, data, child) { builder: (cxt, data, child) {
@ -586,12 +399,8 @@ 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( decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
color: MyColors.redColor, child: data.workListCounter.toString().toText10(color: Colors.white),
borderRadius: BorderRadius.circular(17)),
child: data.workListCounter
.toString()
.toText10(color: Colors.white),
), ),
); );
}, },
@ -603,29 +412,19 @@ 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 color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
? MyColors.grey3AColor
: MyColors.grey98Color,
).paddingAll(4), ).paddingAll(4),
label: LocaleKeys.itemsForSale.tr(), label: LocaleKeys.itemsForSale.tr(),
), ),
], ],
currentIndex: currentIndex, currentIndex: currentIndex,
selectedLabelStyle: const TextStyle( selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
fontSize: 10, unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
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: selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
const IconThemeData(color: MyColors.grey3AColor, size: 28), unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, 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);
@ -656,7 +455,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
} }
}); });
Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
arguments: getOffersDetailList);
} }
} }

@ -18,6 +18,7 @@ class MenusWidget extends StatelessWidget {
return Consumer<DashboardProviderModel>( return Consumer<DashboardProviderModel>(
builder: (cxt, data, child) { builder: (cxt, data, child) {
print("data.workListCounter:${data.workListCounter}");
return GridView( return GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
@ -44,11 +45,7 @@ class MenusWidget extends StatelessWidget {
Expanded( Expanded(
child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.workListCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox( RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
], ],
) )
], ],
@ -75,10 +72,7 @@ class MenusWidget extends StatelessWidget {
Expanded( Expanded(
child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.missingSwipeCounter.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox( RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
], ],
) )
], ],
@ -105,10 +99,7 @@ class MenusWidget extends StatelessWidget {
Expanded( Expanded(
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox( RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
], ],
) )
], ],
@ -135,10 +126,7 @@ class MenusWidget extends StatelessWidget {
Expanded( Expanded(
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox( RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
quarterTurns: AppState().isArabic(context) ? 2:4,
child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)
),
], ],
) )
], ],

@ -123,9 +123,7 @@ class _ItgDetailScreenState extends State<ItgDetailScreen> {
}, },
children: [ children: [
RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []), RequestDetailFragment(fields: itgRequest?.fieldGoups?[1].fields ?? []),
ApprovalLevelfragment( ApprovalLevelfragment(wFHistory: itgRequest?.wFHistory ?? []),
wFHistory: itgRequest?.wFHistory ?? [],
),
RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []), RequestDetailFragment(fields: itgRequest?.fieldGoups?[0].fields ?? []),
], ],
).expanded, ).expanded,

@ -112,16 +112,18 @@ class ApprovalLevelfragment extends StatelessWidget {
} }
Color getStatusColor(String code) { Color getStatusColor(String code) {
if (code == "SUBMIT") { if (code == "Submit") {
return const Color(0xff2E303A); return MyColors.grey3AColor;
} else if (code == "REJECTED") { } else if (code == "Pending") {
return const Color(0xffD02127); return MyColors.yellowColor;
} else if (code == "APPROVED" || code == "Requested Information") { } else if (code == "Not Doable" || code == "Rejected") {
return const Color(0xff1FA269); return MyColors.redColor;
} else if (code == "REQUEST_INFO") { } else if (code == "APPROVED") {
return const Color(0xff2E303A); return MyColors.greenColor;
} else if (code == "Requested Information") {
return MyColors.orange;
} else { } else {
return const Color(0xff2E303A); return MyColors.yellowColor;
} }
} }
} }

@ -441,7 +441,7 @@ class _DelegateSheetState extends State<DelegateSheet> {
onTap: () { onTap: () {
showMyBottomSheet(context, showMyBottomSheet(context,
child: SelectedItemSheet( child: SelectedItemSheet(
"Comment", LocaleKeys.comments.tr(),
apiMode: widget.apiMode, apiMode: widget.apiMode,
replacementList: actionHistory, replacementList: actionHistory,
notificationID: widget.notificationID, notificationID: widget.notificationID,

@ -62,14 +62,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
key: 'POAPPRV', key: 'POAPPRV',
disable: false), disable: false),
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, value: 0, name: 'ITG', fullName: LocaleKeys.ITGForms.tr(), active: false, color: [Color(0xffEB8C90), Color(0xffDE6C70)], icon: "assets/images/miss_swipe.svg", key: 'ITG', disable: false),
name: 'ITG',
fullName: LocaleKeys.ITGForms.tr(),
active: false,
color: [Color(0xffEB8C90), Color(0xffDE6C70)],
icon: "assets/images/miss_swipe.svg",
key: 'ITG',
disable: false),
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, value: 0,
name: 'IC', name: 'IC',
@ -80,23 +73,9 @@ class _WorkListScreenState extends State<WorkListScreen> {
key: 'INVITEM', key: 'INVITEM',
disable: false), disable: false),
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, value: 0, name: 'STAMP', fullName: LocaleKeys.stamp.tr(), active: false, color: [Color(0xff32D892), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'STAMP', disable: false),
name: 'STAMP',
fullName: LocaleKeys.stamp.tr(),
active: false,
color: [Color(0xff32D892), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'STAMP',
disable: false),
WorkListItemTypeModelData( WorkListItemTypeModelData(
value: 0, value: 0, name: 'COC', fullName: LocaleKeys.itemCreation.tr(), active: false, color: [Color(0xff787299), Color(0xff1AB170)], icon: "assets/images/miss_swipe.svg", key: 'COC', disable: true)
name: 'COC',
fullName: LocaleKeys.itemCreation.tr(),
active: false,
color: [Color(0xff787299), Color(0xff1AB170)],
icon: "assets/images/miss_swipe.svg",
key: 'COC',
disable: true)
]; ];
int workListItemIndex = 0; int workListItemIndex = 0;
@ -111,7 +90,6 @@ class _WorkListScreenState extends State<WorkListScreen> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
providerData = Provider.of<DashboardProviderModel>(context, listen: false); providerData = Provider.of<DashboardProviderModel>(context, listen: false);
calculateCounter(); calculateCounter();
getWorkList(); getWorkList();
@ -124,10 +102,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
} else if (workListElement.key == "COC") { } else if (workListElement.key == "COC") {
workListElement.value = providerData.cocFinalCount; workListElement.value = providerData.cocFinalCount;
} else { } else {
var tempList = providerData.getOpenNotificationsList var tempList = providerData.getOpenNotificationsList?.where((notificationElement) => notificationElement.itemType == workListElement.key).toList();
?.where((notificationElement) =>
notificationElement.itemType == workListElement.key)
.toList();
if (tempList!.isNotEmpty) { if (tempList!.isNotEmpty) {
workListElement.value = tempList.first.openNtfNumber ?? 0; workListElement.value = tempList.first.openNtfNumber ?? 0;
} }
@ -138,47 +113,50 @@ class _WorkListScreenState extends State<WorkListScreen> {
ItgFormsModel? itgFormsModel; ItgFormsModel? itgFormsModel;
int? itgRequestTypeIndex; int? itgRequestTypeIndex;
void getWorkList() async { Future<void> getWorkList({bool showLoading = true}) async {
try { try {
Utils.showLoading(context); if (showLoading) Utils.showLoading(context);
if (workListItemTypes[workListItemIndex].key == "ITG") { if (workListItemTypes[workListItemIndex].key == "ITG") {
itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType(); itgFormsModel = await WorkListApiClient().getITGTaskCountRequestType();
List<RequestDetails> requestAllList = []; List<RequestDetails> requestAllList = [];
for (int i = 0; i < (itgFormsModel?.requestType!.length ?? 0); i++) { for (int i = 0; i < (itgFormsModel?.requestType!.length ?? 0); i++) {
itgFormsModel?.requestType![i].requestDetails?.forEach((element) { itgFormsModel?.requestType![i].requestDetails?.forEach((element) {
element.requestType = element.requestType = itgFormsModel?.requestType![i].requestTypeCode;
itgFormsModel?.requestType![i].requestTypeCode;
}); });
requestAllList = requestAllList + requestAllList = requestAllList + (itgFormsModel?.requestType![i].requestDetails ?? []);
(itgFormsModel?.requestType![i].requestDetails ?? []);
} }
AppState().setRequestAllList = requestAllList; AppState().setRequestAllList = requestAllList;
itgFormsModel?.requestType!.insert( itgFormsModel?.requestType!.insert(0, RequestType(requestDetails: requestAllList, requestTypeCode: "all", requestTypeName: "All"));
0,
RequestType(
requestDetails: requestAllList,
requestTypeCode: "all",
requestTypeName: "All"));
if ((itgFormsModel?.requestType?.length ?? 0) > 0) { if ((itgFormsModel?.requestType?.length ?? 0) > 0) {
itgRequestTypeIndex = 0; itgRequestTypeIndex = 0;
} }
} else { } else {
itgRequestTypeIndex = null; itgRequestTypeIndex = null;
workList = await WorkListApiClient() workList = await WorkListApiClient().getWorkList(pageNumber, workListItemTypes[workListItemIndex].key);
.getWorkList(pageNumber, workListItemTypes[workListItemIndex].key);
AppState().setWorkList = workList; AppState().setWorkList = workList;
} }
Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
setState(() {}); if (showLoading) setState(() {});
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); if (showLoading) Utils.hideLoading(context);
Utils.handleException(ex, context, null); if (showLoading) Utils.handleException(ex, context, null);
} }
} }
void _onRefresh() async { void _onRefresh() async {
getWorkList(); try {
_refreshController.refreshCompleted(); _refreshController.refreshCompleted();
Utils.showLoading(context);
List dataOnRefresh = await Future.wait([
providerData.fetchWorkListCounter(context, showLoading: false),
getWorkList(showLoading: false),
]);
calculateCounter();
setState(() {});
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
}
} }
@override @override
@ -207,23 +185,13 @@ class _WorkListScreenState extends State<WorkListScreen> {
child: ListView.separated( child: ListView.separated(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(left: 21, right: 21, top: 8, bottom: 8),
left: 21, right: 21, top: 8, bottom: 8),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(6), color: workListItemIndex == index ? MyColors.darkIconColor : MyColors.lightGreyEAColor),
borderRadius: BorderRadius.circular(6), child: ("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
color: workListItemIndex == index .toText12(color: workListItemIndex == index ? MyColors.white : MyColors.black),
? MyColors.darkIconColor
: MyColors.lightGreyEAColor),
child:
("${workListItemTypes[index].name} ${workListItemTypes[index].value > 0 ? "(${workListItemTypes[index].value})" : ""}")
.toText12(
color: workListItemIndex == index
? MyColors.white
: MyColors.black),
).onPress(() { ).onPress(() {
if (workListItemIndex != index && if (workListItemIndex != index && !workListItemTypes[index].disable) {
!workListItemTypes[index].disable) {
workListItemIndex = index; workListItemIndex = index;
if (workListItemTypes[index].value == 0) { if (workListItemTypes[index].value == 0) {
workList = []; workList = [];
@ -316,17 +284,14 @@ class _WorkListScreenState extends State<WorkListScreen> {
); );
} }
Widget itgRowItem(WorkListItemTypeModelData data, Widget itgRowItem(WorkListItemTypeModelData data, RequestDetails requestDetails, int index) {
RequestDetails requestDetails, int index) {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
AppState().setItgWorkListIndex = index; AppState().setItgWorkListIndex = index;
var shouldReloadData = var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.itgDetail);
await Navigator.pushNamed(context, AppRoutes.itgDetail);
if (shouldReloadData != null) { if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") { if (shouldReloadData.toString() == "delegate_reload") {
providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount = providerData.itgFormsModel!.totalCount! - 1;
providerData.itgFormsModel!.totalCount! - 1;
calculateCounter(); calculateCounter();
getWorkList(); getWorkList();
} }
@ -350,8 +315,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -370,20 +334,11 @@ class _WorkListScreenState extends State<WorkListScreen> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
gradient: LinearGradient( gradient: LinearGradient(transform: GradientRotation(.218), begin: Alignment.topRight, end: Alignment.bottomRight, colors: data.color),
transform: GradientRotation(.218),
begin: Alignment.topRight,
end: Alignment.bottomRight,
colors: data.color),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [SvgPicture.asset("assets/images/miss_swipe.svg", width: 20, height: 20, color: Colors.white), 2.height, data.name.toText10(color: Colors.white)],
SvgPicture.asset("assets/images/miss_swipe.svg",
width: 20, height: 20, color: Colors.white),
2.height,
data.name.toText10(color: Colors.white)
],
).paddingAll(6), ).paddingAll(6),
), ),
8.width, 8.width,
@ -409,15 +364,12 @@ class _WorkListScreenState extends State<WorkListScreen> {
); );
} }
Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, Widget rowItem(WorkListItemTypeModelData data, WorkListResponseModel workData, int index) {
int index) {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
AppState().setWorkListIndex = index; AppState().setWorkListIndex = index;
var data = workList![index]; var data = workList![index];
var shouldReloadData = await Navigator.pushNamed( var shouldReloadData = await Navigator.pushNamed(context, AppRoutes.workListDetail, arguments: workData);
context, AppRoutes.workListDetail,
arguments: workData);
if (shouldReloadData != null) { if (shouldReloadData != null) {
if (shouldReloadData.toString() == "delegate_reload") { if (shouldReloadData.toString() == "delegate_reload") {
calculateCounter(); calculateCounter();
@ -442,8 +394,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: padding: const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
const EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -462,20 +413,11 @@ class _WorkListScreenState extends State<WorkListScreen> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
gradient: LinearGradient( gradient: LinearGradient(transform: GradientRotation(.218), begin: Alignment.topRight, end: Alignment.bottomRight, colors: data.color),
transform: GradientRotation(.218),
begin: Alignment.topRight,
end: Alignment.bottomRight,
colors: data.color),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [SvgPicture.asset("assets/images/miss_swipe.svg", width: 20, height: 20, color: Colors.white), 2.height, data.name.toText10(color: Colors.white)],
SvgPicture.asset("assets/images/miss_swipe.svg",
width: 20, height: 20, color: Colors.white),
2.height,
data.name.toText10(color: Colors.white)
],
).paddingAll(6), ).paddingAll(6),
), ),
8.width, 8.width,

@ -135,9 +135,28 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
if (getNotificationRespondAttributes.isNotEmpty) { if (getNotificationRespondAttributes.isNotEmpty) {
notificationNoteInput = getNotificationRespondAttributes.first; notificationNoteInput = getNotificationRespondAttributes.first;
} }
notificationButtonsList = await WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!);
actionHistoryList = await WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!); List dataToFetch = await Future.wait([
getAttachmentList = await WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!); WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!),
WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!),
WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!),
]);
notificationButtonsList = dataToFetch[0];
actionHistoryList = dataToFetch[1];
getAttachmentList = dataToFetch[2];
// List<Future> futureRequest = [];
// List<Object> futureObject = [];
//
// addRequestInFuture(notificationButtonsList, WorkListApiClient().getNotificationButtons(workListData!.nOTIFICATIONID!));
// addRequestInFuture(actionHistoryList, WorkListApiClient().getActionHistory(workListData!.nOTIFICATIONID!));
// addRequestInFuture(getAttachmentList, WorkListApiClient().getAttachments(workListData!.nOTIFICATIONID!));
// List dataToFetch = await Future.wait(futureRequest);
// for(int i=0;i<dataToFetch.length;i++) {
// futureObject[i] = dataToFetch[i];
// }
if (notificationButtonsList.isNotEmpty) { if (notificationButtonsList.isNotEmpty) {
isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE"); isCloseAvailable = notificationButtonsList.any((element) => element.bUTTONACTION == "CLOSE");
@ -152,6 +171,14 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
} }
} }
List<Future> futureRequest = [];
List<Object> futureObject = [];
void addRequestInFuture(data, request) {
futureObject.add(data);
futureRequest.add(request);
}
void getDataFromState() { void getDataFromState() {
if (workListData == null) { if (workListData == null) {
workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel; workListData = AppState().workList![AppState().workListIndex!]; // ModalRoute.of(context)!.settings.arguments as WorkListResponseModel;
@ -196,6 +223,7 @@ class _WorkListDetailScreenState extends State<WorkListDetailScreen> {
], ],
), ),
), ),
if ((workListData?.sUBJECT ?? "").isNotEmpty) workListData!.sUBJECT!.toText14().paddingOnly(top: 20, right: 21, left: 21),
PageView( PageView(
controller: controller, controller: controller,
onPageChanged: (pageIndex) { onPageChanged: (pageIndex) {

@ -8,6 +8,7 @@ import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/get_action_history_list_model.dart'; import 'package:mohem_flutter_app/models/get_action_history_list_model.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart'; import 'package:mohem_flutter_app/ui/work_list/sheets/delegate_sheet.dart';
import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart';
import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
@ -77,11 +78,11 @@ class ActionsFragment extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
actionHistory.nAME!.toText16(), actionHistory.nAME!.toText16(),
if ((actionHistory.nOTE ?? "").isNotEmpty) actionHistory.nOTE!.toText12(color: MyColors.grey57Color), if ((actionHistory.nOTE ?? "").isNotEmpty) "Note: ${actionHistory.nOTE!}".toText12(color: MyColors.grey57Color),
4.height, 4.height,
Row( Row(
children: [ children: [
actionHistory.aCTION!.toText10(), actionHistory.aCTION!.toText10(color: getStatusColor(actionHistory.aCTIONCODE!)),
8.width, 8.width,
if (actionHistory.nOTIFICATIONDATE!.isNotEmpty) if (actionHistory.nOTIFICATIONDATE!.isNotEmpty)
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor), DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(actionHistory.nOTIFICATIONDATE!), false).toText12(color: MyColors.lightTextColor),
@ -100,7 +101,15 @@ class ActionsFragment extends StatelessWidget {
}).expanded, }).expanded,
Container(width: 1, height: 30, color: MyColors.lightGreyEFColor), Container(width: 1, height: 30, color: MyColors.lightGreyEFColor),
LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() { LocaleKeys.delegate.tr().toText12(color: MyColors.gradiantEndColor).center.paddingOnly(top: 6, bottom: 6).onPress(() {
showMyBottomSheet(context, child: DelegateSheet(title: "Delegate", apiMode: "DELEGATE", notificationID: notificationID, actionHistoryList: actionHistoryList)); showMyBottomSheet(
context,
child: SelectedItemSheet(
LocaleKeys.comments.tr(),
apiMode: "DELEGATE",
actionHistoryList: actionHistory,
notificationID: notificationID,
),
);
}).expanded, }).expanded,
], ],
), ),

@ -4,6 +4,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/utils.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';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
@ -21,18 +22,18 @@ class AttachmentsFragment extends StatelessWidget {
return ListView.separated( return ListView.separated(
itemCount: getAttachmentList.length, itemCount: getAttachmentList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Row( return Row(
children: [ children: [
SvgPicture.asset(determineFileIcon(getAttachmentList[index].fILECONTENTTYPE ?? "")), SvgPicture.asset(determineFileIcon(getAttachmentList[index].fILECONTENTTYPE ?? "")),
12.width, 12.width,
(getAttachmentList[index].fILENAME?.capitalizeFirstofEach ?? "").toText16().expanded, (getAttachmentList[index].fILENAME ?? "").toText16().expanded,
], ],
).objectContainerView().onPress(() async { ).objectContainerView().onPress(() async {
try { try {
String path = await _createFileFromString(getAttachmentList[index].fILEDATA ?? "", getAttachmentList[index].fILECONTENTTYPE ?? ""); String path = await _createFileFromString(getAttachmentList[index].fILEDATA ?? "", getAttachmentList[index].fILECONTENTTYPE ?? "");
OpenFile.open(path); OpenFile.open(path);
} catch (ex) { } catch (ex) {Utils.showToast("Cannot open file.");
debugPrint("FileErorr:$ex");
} }
}); });
}, },

Loading…
Cancel
Save