code format monthly attendance

merge-requests/120/head
Sikander Saleem 3 years ago
parent 47b712d132
commit 705adbc17e

@ -112,7 +112,8 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
], ],
).onPress(() async { ).onPress(() async {
showMonthPicker( showMonthPicker(
context: context, //locale: EasyLocalization.of(context)?.locale, context: context,
//locale: EasyLocalization.of(context)?.locale,
initialDate: formattedDate, initialDate: formattedDate,
firstDate: DateTime(searchYear - 2), firstDate: DateTime(searchYear - 2),
lastDate: DateTime.now(), lastDate: DateTime.now(),
@ -419,211 +420,211 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
} }
if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) { if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) {
int val = details.date!.day; int val = details.date!.day;
getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ? getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y'
showModalBottomSheet( ? showModalBottomSheet(
context: context, context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
isScrollControlled: true, isScrollControlled: true,
backgroundColor: MyColors.backgroundBlackColor, backgroundColor: MyColors.backgroundBlackColor,
builder: (_) { builder: (_) {
return DraggableScrollableSheet( return DraggableScrollableSheet(
maxChildSize: 0.9, maxChildSize: 0.9,
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString); DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(
width: 49, width: 49,
height: 7, height: 7,
margin: const EdgeInsets.symmetric(vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25), borderRadius: BorderRadius.circular(25),
color: MyColors.darkGreyColor, color: MyColors.darkGreyColor,
), ),
), ),
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
controller: controller, controller: controller,
itemCount: 1, itemCount: 1,
itemBuilder: (_, i) => itemBuilder: (_, i) => Container(
Container( decoration: const BoxDecoration(
decoration: const BoxDecoration( borderRadius: BorderRadius.vertical(
borderRadius: BorderRadius.vertical( top: Radius.circular(25.0),
top: Radius.circular(25.0), ),
color: MyColors.backgroundBlackColor,
), ),
color: MyColors.backgroundBlackColor, child: Column(
), children: [
child: Column( Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
children: [ LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor),
"${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), 12.height,
LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), CircularStepProgressBar(
12.height, totalSteps: 16 * 4,
CircularStepProgressBar( currentStep: percentage,
totalSteps: 16 * 4, width: 224,
currentStep: percentage, height: 236,
width: 224, selectedColor: MyColors.gradiantEndColor,
height: 236, unselectedColor: MyColors.grey70Color,
selectedColor: MyColors.gradiantEndColor, child: Column(
unselectedColor: MyColors.grey70Color, mainAxisSize: MainAxisSize.min,
child: Column( children: [
mainAxisSize: MainAxisSize.min, "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true),
children: [ LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor),
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), 28.height,
LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor),
28.height, "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true),
LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), ],
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), ).center,
],
).center, ).center,
).center, ],
], ).paddingOnly(left: 21, right: 21, top: 27, bottom: 37),
).paddingOnly(left: 21, right: 21, top: 27, bottom: 37), Stack(
Stack( children: [
children: [ Container(
Container( width: double.infinity,
width: double.infinity, decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white), padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29),
padding: const EdgeInsets.only(left: 31, right: 31, top: 30, bottom: 29), child: Column(
child: Column( children: [
children: [ Row(
Row( children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.actualCheckIn.tr().toText11(
LocaleKeys.actualCheckIn.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != ""
"${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true)
? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) : "__".toText22(color: Colors.black, isBold: true),
: "__".toText22(color: Colors.black, isBold: true), ],
], ).expanded,
).expanded, Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.actualCheckOut.tr().toText11(
LocaleKeys.actualCheckOut.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != ""
"${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true)
? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) : "__".toText22(color: Colors.black, isBold: true),
: "__".toText22(color: Colors.black, isBold: true), ],
], ).expanded,
).expanded, ],
], ),
), 25.height,
25.height, const Divider(
const Divider( height: 1,
height: 1, thickness: 1,
thickness: 1, color: MyColors.lightGreyEFColor,
color: MyColors.lightGreyEFColor, ),
), 25.height,
25.height, Row(
Row( children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.approvedCheckIn.tr().toText11(
LocaleKeys.approvedCheckIn.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != ""
"${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true)
? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) : "__".toText22(color: MyColors.greenColor, isBold: true),
: "__".toText22(color: MyColors.greenColor, isBold: true), ],
], ).expanded,
).expanded, Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.approvedCheckOut.tr().toText11(
LocaleKeys.approvedCheckOut.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != ""
"${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true)
? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) : "__".toText22(color: MyColors.greenColor, isBold: true),
: "__".toText22(color: MyColors.greenColor, isBold: true), ],
], ).expanded,
).expanded, ],
], ),
), 25.height,
25.height, const Divider(
const Divider( height: 1,
height: 1, thickness: 1,
thickness: 1, color: MyColors.lightGreyEFColor,
color: MyColors.lightGreyEFColor, ),
), 25.height,
25.height, Row(
Row( children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.lateIn.tr().toText11(
LocaleKeys.lateIn.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true),
"${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), ],
], ).expanded,
).expanded, Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.excess.tr().toText11(
LocaleKeys.excess.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), ],
], ).expanded,
).expanded, ],
], ),
), 25.height,
25.height, const Divider(
const Divider( height: 1,
height: 1, thickness: 1,
thickness: 1, color: MyColors.lightGreyEFColor,
color: MyColors.lightGreyEFColor, ),
), 25.height,
25.height, Row(
Row( children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.shortage.tr().toText11(
LocaleKeys.shortage.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
"${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), ],
], ).expanded,
).expanded, Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ LocaleKeys.earlyOut.tr().toText11(
LocaleKeys.earlyOut.tr().toText11( color: MyColors.grey67Color,
color: MyColors.grey67Color, ),
), "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), ],
], ).expanded,
).expanded, ],
], ),
), ],
], ),
), ),
), ],
], ),
), ],
], ),
), ),
), ),
), ),
), ],
], );
); },
}, );
); },
}, )
):null; : null;
} }
} }

Loading…
Cancel
Save