diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index ebbf03f..39f33a4 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -416,209 +416,214 @@ class _MonthlyAttendanceScreenState extends State { } else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") { percentage = 0; } - showModalBottomSheet( - context: context, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), - isScrollControlled: true, - backgroundColor: MyColors.backgroundBlackColor, - builder: (_) { - return DraggableScrollableSheet( - maxChildSize: 0.9, - expand: false, - builder: (_, controller) { - dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); - return Column( - children: [ - Container( - width: 49, - height: 7, - margin: const EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: MyColors.darkGreyColor, + if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) { + int val = details.date!.day; + getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ? + showModalBottomSheet( + context: context, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), + isScrollControlled: true, + backgroundColor: MyColors.backgroundBlackColor, + builder: (_) { + return DraggableScrollableSheet( + maxChildSize: 0.9, + expand: false, + builder: (_, controller) { + dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + return Column( + children: [ + Container( + width: 49, + height: 7, + margin: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: MyColors.darkGreyColor, + ), ), - ), - Expanded( - child: ListView.builder( - controller: controller, - itemCount: 1, - itemBuilder: (_, i) => Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.vertical( - top: Radius.circular(25.0), - ), - color: MyColors.backgroundBlackColor, - ), - child: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), - LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), - 12.height, - CircularStepProgressBar( - totalSteps: 16 * 4, - currentStep: percentage, - width: 224, - height: 236, - selectedColor: MyColors.gradiantEndColor, - unselectedColor: MyColors.grey70Color, - child: Column( - mainAxisSize: MainAxisSize.min, + Expanded( + child: ListView.builder( + controller: controller, + itemCount: 1, + itemBuilder: (_, i) => + Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(25.0), + ), + color: MyColors.backgroundBlackColor, + ), + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), - LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), - 28.height, - LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), - "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), + "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), + LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), + 12.height, + CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: percentage, + width: 224, + height: 236, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), + LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), + 28.height, + 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), - Stack( - children: [ - Container( - width: double.infinity, - 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), - child: Column( + ).paddingOnly(left: 21, right: 21, top: 27, bottom: 37), + Stack( children: [ - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.actualCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) - : "__".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.actualCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" - ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) - : "__".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.approvedCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) - : "__".toText22(color: MyColors.greenColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.approvedCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" - ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) - : "__".toText22(color: MyColors.greenColor, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.lateIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.excess.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.shortage.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.earlyOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - ], + Container( + width: double.infinity, + 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), + child: Column( + children: [ + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.actualCheckIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" + ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.actualCheckOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" + ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.approvedCheckIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" + ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) + : "__".toText22(color: MyColors.greenColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.approvedCheckOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" + ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) + : "__".toText22(color: MyColors.greenColor, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.lateIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.excess.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.shortage.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.earlyOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + ], + ), + ], + ), ), ], ), - ), - ], + ], + ), ), - ], - ), ), ), - ), - ], - ); - }, - ); - }, - ); + ], + ); + }, + ); + }, + ):null; + } } List _getDataSource() { diff --git a/lib/ui/login/change_password_screen.dart b/lib/ui/login/change_password_screen.dart index 0409500..01603d9 100644 --- a/lib/ui/login/change_password_screen.dart +++ b/lib/ui/login/change_password_screen.dart @@ -91,7 +91,7 @@ class _ChangePasswordScreenState extends State { LocaleKeys.confirmPassword.tr(), "**********", confirmPassword, - isObscureText: true, + isTextIsPassword: true, onChange: (value) { setState(() {}); }, diff --git a/lib/ui/login/login_screen.dart b/lib/ui/login/login_screen.dart index f8ec8e5..92a58db 100644 --- a/lib/ui/login/login_screen.dart +++ b/lib/ui/login/login_screen.dart @@ -179,7 +179,7 @@ class _LoginScreenState extends State { 16.height, InputWidget(LocaleKeys.username.tr(), "123456", username), 12.height, - InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isObscureText: true), + InputWidget(LocaleKeys.password.tr(), "xxxxxx", password, isTextIsPassword: true), 9.height, Align( alignment: Alignment.centerRight, diff --git a/lib/ui/login/new_password_screen.dart b/lib/ui/login/new_password_screen.dart index e2ef55d..8bb1443 100644 --- a/lib/ui/login/new_password_screen.dart +++ b/lib/ui/login/new_password_screen.dart @@ -85,7 +85,7 @@ class _NewPasswordScreenState extends State { LocaleKeys.confirmPassword.tr(), "**********", confirmPassword, - isObscureText: true, + isTextIsPassword: true, onChange: (value) { setState(() {}); }, diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 555cfb0..5d55ee8 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -424,209 +424,214 @@ class _ViewAttendanceState extends State { } else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") { percentage = 0; } - showModalBottomSheet( - context: context, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), - isScrollControlled: true, - backgroundColor: MyColors.backgroundBlackColor, - builder: (_) { - return DraggableScrollableSheet( - maxChildSize: 0.9, - expand: false, - builder: (_, controller) { - dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; - DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); - return Column( - children: [ - Container( - width: 49, - height: 7, - margin: const EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: MyColors.darkGreyColor, + if (details.date!.month == formattedDate.month && details.date!.year == formattedDate.year) { + int val = details.date!.day; + getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y' ? + showModalBottomSheet( + context: context, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), + isScrollControlled: true, + backgroundColor: MyColors.backgroundBlackColor, + builder: (_) { + return DraggableScrollableSheet( + maxChildSize: 0.9, + expand: false, + builder: (_, controller) { + dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE; + DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString); + return Column( + children: [ + Container( + width: 49, + height: 7, + margin: const EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: MyColors.darkGreyColor, + ), ), - ), - Expanded( - child: ListView.builder( - controller: controller, - itemCount: 1, - itemBuilder: (_, i) => Container( - decoration: const BoxDecoration( - borderRadius: BorderRadius.vertical( - top: Radius.circular(25.0), - ), - color: MyColors.backgroundBlackColor, - ), - child: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), - LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), - 12.height, - CircularStepProgressBar( - totalSteps: 16 * 4, - currentStep: percentage, - width: 224, - height: 236, - selectedColor: MyColors.gradiantEndColor, - unselectedColor: MyColors.grey70Color, - child: Column( - mainAxisSize: MainAxisSize.min, + Expanded( + child: ListView.builder( + controller: controller, + itemCount: 1, + itemBuilder: (_, i) => + Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(25.0), + ), + color: MyColors.backgroundBlackColor, + ), + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), - LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), - 28.height, - LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), - "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), + "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), + LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor), + 12.height, + CircularStepProgressBar( + totalSteps: 16 * 4, + currentStep: percentage, + width: 224, + height: 236, + selectedColor: MyColors.gradiantEndColor, + unselectedColor: MyColors.grey70Color, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), + LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), + 28.height, + 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), - Stack( - children: [ - Container( - width: double.infinity, - 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), - child: Column( + ).paddingOnly(left: 21, right: 21, top: 27, bottom: 37), + Stack( children: [ - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.actualCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) - : "__".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.actualCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" - ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) - : "__".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.approvedCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) - : "__".toText22(color: MyColors.greenColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.approvedCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" - ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) - : "__".toText22(color: MyColors.greenColor, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.lateIn.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.excess.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), - ], - ).expanded, - ], - ), - 25.height, - const Divider( - height: 1, - thickness: 1, - color: MyColors.lightGreyEFColor, - ), - 25.height, - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.shortage.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), - ], - ).expanded, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.earlyOut.tr().toText11( - color: MyColors.grey67Color, - ), - "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), - ], - ).expanded, - ], + Container( + width: double.infinity, + 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), + child: Column( + children: [ + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.actualCheckIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" + ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.actualCheckOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" + ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.approvedCheckIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" + ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) + : "__".toText22(color: MyColors.greenColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.approvedCheckOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}" != "" + ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) + : "__".toText22(color: MyColors.greenColor, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.lateIn.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.excess.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), + ], + ).expanded, + ], + ), + 25.height, + const Divider( + height: 1, + thickness: 1, + color: MyColors.lightGreyEFColor, + ), + 25.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.shortage.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.earlyOut.tr().toText11( + color: MyColors.grey67Color, + ), + "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), + ], + ).expanded, + ], + ), + ], + ), ), ], ), - ), - ], + ], + ), ), - ], - ), ), ), - ), - ], - ); - }, - ); - }, - ); + ], + ); + }, + ); + }, + ):null; + } } List _getDataSource() { List meetings = []; diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index d81ead0..5059733 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; -class InputWidget extends StatelessWidget { +class InputWidget extends StatefulWidget { final String labelText; final String hintText; final TextEditingController controller; @@ -10,7 +12,7 @@ class InputWidget extends StatelessWidget { final bool hasSelection; final int? lines; final bool isInputTypeNum; - final bool isObscureText; + final bool isTextIsPassword; final bool isBackgroundEnable; final bool isEnableBorder; final double verticalPadding; @@ -21,7 +23,8 @@ class InputWidget extends StatelessWidget { this.labelText, this.hintText, this.controller, { - this.isObscureText = false, + Key? key, + this.isTextIsPassword = false, this.suffixTap, this.isEnable = true, this.hasSelection = false, @@ -32,23 +35,43 @@ class InputWidget extends StatelessWidget { this.isBackgroundEnable = false, this.verticalPadding = 15, this.horizontalPadding = 16, - }); + }) : super(key: key); + + @override + _InputWidgetState createState() { + return _InputWidgetState(); + } +} + +class _InputWidgetState extends State { + late bool isObscureText; + + @override + void initState() { + super.initState(); + isObscureText = widget.isTextIsPassword; + } + + @override + void dispose() { + super.dispose(); + } @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only(left: horizontalPadding, right: horizontalPadding, bottom: verticalPadding, top: verticalPadding), + padding: EdgeInsets.only(left: widget.horizontalPadding, right: widget.horizontalPadding, bottom: widget.verticalPadding, top: widget.verticalPadding), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), - color: isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white, + color: widget.isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white, border: Border.all( - color: isEnableBorder ? Color(0xffefefef) : Colors.transparent, + color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent, width: 1, ), ), child: InkWell( - onTap: hasSelection ? () {} : null, + onTap: widget.hasSelection ? () {} : null, child: Row( children: [ Expanded( @@ -57,7 +80,7 @@ class InputWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - labelText, + widget.labelText, style: const TextStyle( fontSize: 11, fontWeight: FontWeight.w600, @@ -66,14 +89,14 @@ class InputWidget extends StatelessWidget { ), ), TextField( - enabled: isEnable, + enabled: widget.isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text, - controller: controller, - maxLines: lines, + keyboardType: widget.isInputTypeNum ? TextInputType.number : TextInputType.text, + controller: widget.controller, + maxLines: widget.lines, obscuringCharacter: "*", obscureText: isObscureText, - onChanged: onChange, + onChanged: widget.onChange, style: const TextStyle( fontSize: 14, height: 21 / 14, @@ -83,7 +106,7 @@ class InputWidget extends StatelessWidget { ), decoration: InputDecoration( isDense: true, - hintText: hintText, + hintText: widget.hintText, hintStyle: const TextStyle( fontSize: 14, height: 21 / 14, @@ -92,7 +115,7 @@ class InputWidget extends StatelessWidget { letterSpacing: -0.56, ), suffixIconConstraints: const BoxConstraints(minWidth: 50), - suffixIcon: suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: suffixTap), + suffixIcon: widget.suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: widget.suffixTap), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -102,7 +125,15 @@ class InputWidget extends StatelessWidget { ], ), ), - if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + if (widget.isTextIsPassword) ...[ + 16.width, + Icon(isObscureText ? Icons.visibility_rounded : Icons.visibility_off_rounded).onPress(() { + setState(() { + isObscureText = !isObscureText; + }); + }) + ], + if (widget.hasSelection) Icon(Icons.keyboard_arrow_down_outlined), ], ), ),