diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index afdb821..4419fc8 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -389,8 +389,10 @@ "itemInfo": "معلومات العنصر", "uploadAttachment": "تحميل المرفق", "selectFromGalleryOrOpenCamera": "اختر من المعرض أو فتح الكاميرا", - "openCamera": "فتح\nآلة تصوير", - "uploadFromGallery": "تحميل من\nصالة عرض", + "openCamera": "فتح\nالكاميرا", + "uploadFromGallery": "تحميل من\nملفات الجهاز", + "name": "الأسم", + "email": "ايميل", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 3527630..5dff64b 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -391,6 +391,8 @@ "selectFromGalleryOrOpenCamera": "Select from gallery or open camera", "openCamera": "Open\nCamera", "uploadFromGallery": "Upload from\nGallery", + "name": "Name", + "email": "Email", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 96e1e09..369b702 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -403,6 +403,12 @@ class CodegenLoader extends AssetLoader{ "itemPrice": "سعر السلعة", "itemPhotos": "صور البند", "itemInfo": "معلومات العنصر", + "uploadAttachment": "تحميل المرفق", + "selectFromGalleryOrOpenCamera": "اختر من المعرض أو فتح الكاميرا", + "openCamera": "فتح\nالكاميرا", + "uploadFromGallery": "تحميل من\nملفات الجهاز", + "name": "الأسم", + "email": "ايميل", "profile": { "reset_password": { "label": "Reset Password", @@ -826,6 +832,12 @@ static const Map en_US = { "itemPrice": "Item Price", "itemPhotos": "Item Photos", "itemInfo": "Item Info", + "uploadAttachment": "Upload Attachment", + "selectFromGalleryOrOpenCamera": "Select from gallery or open camera", + "openCamera": "Open\nCamera", + "uploadFromGallery": "Upload from\nGallery", + "name": "Name", + "email": "Email", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index b111cd2..45ca27c 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -388,6 +388,12 @@ abstract class LocaleKeys { static const itemPrice = 'itemPrice'; static const itemPhotos = 'itemPhotos'; static const itemInfo = 'itemInfo'; + static const uploadAttachment = 'uploadAttachment'; + static const selectFromGalleryOrOpenCamera = 'selectFromGalleryOrOpenCamera'; + static const openCamera = 'openCamera'; + static const uploadFromGallery = 'uploadFromGallery'; + static const name = 'name'; + static const email = 'email'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/ui/attendance/monthly_attendance_screen.dart b/lib/ui/attendance/monthly_attendance_screen.dart index 93525a9..9c4ffd7 100644 --- a/lib/ui/attendance/monthly_attendance_screen.dart +++ b/lib/ui/attendance/monthly_attendance_screen.dart @@ -90,52 +90,51 @@ class _MonthlyAttendanceScreenState extends State { "Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0, }; return Scaffold( - appBar: AppBar( - backgroundColor: MyColors.white, - leading: IconButton( - icon: const Icon( - Icons.arrow_back_ios, - color: MyColors.backgroundBlackColor, - ), - onPressed: () => Navigator.pop(context), - ), - ), - backgroundColor: Colors.white, + backgroundColor: MyColors.backgroundColor, body: ListView( scrollDirection: Axis.vertical, children: [ Column( children: [ - 20.height, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.darkIconColor), - Row( - children: [ - "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), - const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), - ], - ).onPress(() async { - showMonthPicker( - context: context, //locale: EasyLocalization.of(context)?.locale, - initialDate: formattedDate, - firstDate: DateTime(searchYear - 2), - lastDate: DateTime.now(), - ).then((selectedDate) { - if (selectedDate != null) { - searchMonth = getMonth(selectedDate.month); - searchYear = selectedDate.year; - formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); - // _calendarController.selectedDate = formattedDate; - callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); - } - }); - }) - ], - ).paddingOnly(left: 21, right: 21), - 18.height, - AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 21, right: 21), + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + IconButton( + icon: const Icon( + Icons.arrow_back_ios, + color: MyColors.backgroundBlackColor, + ), + onPressed: () => Navigator.pop(context), + ), + 20.height, + LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.grey3AColor), + Row( + children: [ + "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.greyACColor), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), + ], + ).onPress(() async { + showMonthPicker( + context: context, //locale: EasyLocalization.of(context)?.locale, + initialDate: formattedDate, + firstDate: DateTime(searchYear - 2), + lastDate: DateTime.now(), + ).then((selectedDate) { + if (selectedDate != null) { + searchMonth = getMonth(selectedDate.month); + searchYear = selectedDate.year; + formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); + callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); + } + }); + }), + 18.height, + AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()), + ], + ).paddingOnly(left: 21, right: 21, top:40), + ), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -148,18 +147,19 @@ class _MonthlyAttendanceScreenState extends State { optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS != null ? getTimeCardSummaryList!.sHORTAGEHRS : 0}"), ], ).paddingOnly(left: 21, right: 21), - 35.height, + 38.height, Container( - width: double.infinity, - height: 227, decoration: BoxDecoration( color: Colors.white, - borderRadius: const BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(25.0), + topRight: Radius.circular(25.0), + ), boxShadow: [ BoxShadow( - offset: const Offset(0, 2), + offset: const Offset(0, 1), blurRadius: 26, - color: MyColors.darkColor.withOpacity(0.1), + color: Color(0xff000014).withOpacity(0.1), ), ], ), @@ -168,12 +168,8 @@ class _MonthlyAttendanceScreenState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - children: [ - LocaleKeys.attendance.tr().toText12(isBold: true, color: MyColors.grey3AColor), - LocaleKeys.stats.tr().toText24(isBold: true, color: MyColors.grey3AColor), - ], - ).paddingOnly(left: 21, top: 29, bottom: 36, right: 23), + "${LocaleKeys.attendance.tr()} ${LocaleKeys.stats.tr()}".toSectionHeading(), + 29.height, Row( children: [ Container( @@ -184,12 +180,11 @@ class _MonthlyAttendanceScreenState extends State { borderRadius: BorderRadius.circular(100), ), ), - Container( - margin: const EdgeInsets.only(left: 5, right: 5), - child: "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor), - ), + 7.width, + "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16( + isBold: true, color: MyColors.lightGreenColor), ], - ).paddingOnly(left: 21, right: 23), + ), 8.height, Row( children: [ @@ -201,53 +196,44 @@ class _MonthlyAttendanceScreenState extends State { borderRadius: BorderRadius.circular(100), ), ), - Container( - margin: const EdgeInsets.only(left: 5, right: 5), - child: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS}".toText16( - isBold: true, - color: MyColors.backgroundBlackColor, - ), + 7.width, + "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16( + isBold: true, color: MyColors.backgroundBlackColor, ) ], - ).paddingOnly(left: 21, top: 8, right: 23), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 169, - height: 170, - child: PieChart( - dataMap: dataMap, - animationDuration: const Duration(milliseconds: 800), - chartLegendSpacing: 0, - chartRadius: MediaQuery.of(context).size.width / 5.2, - colorList: _colorList, - initialAngleInDegree: 0, - chartType: ChartType.ring, - ringStrokeWidth: 80, - legendOptions: const LegendOptions( - showLegendsInRow: false, - showLegends: false, - ), - chartValuesOptions: const ChartValuesOptions( - showChartValueBackground: false, - showChartValues: true, - showChartValuesInPercentage: true, - showChartValuesOutside: false, - decimalPlaces: 1, - chartValueStyle: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: MyColors.white, - )), - ), ), ], - ).paddingOnly(left: 65, top: 27, right: 21, bottom: 28), + ).expanded, + 44.width, + AspectRatio(aspectRatio: 1/1, + child: PieChart( + dataMap: dataMap, + animationDuration: const Duration(milliseconds: 800), + chartLegendSpacing: 0, + chartRadius: MediaQuery.of(context).size.width / 5.2, + colorList: _colorList, + initialAngleInDegree: 0, + chartType: ChartType.ring, + ringStrokeWidth: 80, + legendOptions: const LegendOptions( + showLegendsInRow: false, + showLegends: false, + ), + chartValuesOptions: const ChartValuesOptions( + showChartValueBackground: false, + showChartValues: true, + showChartValuesInPercentage: true, + showChartValuesOutside: false, + decimalPlaces: 1, + chartValueStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: MyColors.white, + )), + ), + ).expanded, ], - ), + ).paddingOnly(left: 21, right: 21, top: 29, bottom: 28), ), ], ), @@ -260,14 +246,14 @@ class _MonthlyAttendanceScreenState extends State { return AspectRatio( aspectRatio: 1 / 1, child: Container( - padding: const EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 10), + padding: const EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 5), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(15), boxShadow: [ BoxShadow( offset: const Offset(0, 1), - blurRadius: 15, + blurRadius: 26, color: MyColors.darkColor.withOpacity(0.1), ), ], @@ -304,14 +290,6 @@ class _MonthlyAttendanceScreenState extends State { dayFormat: 'EEE', showTrailingAndLeadingDates: false, showAgenda: false, - //navigationDirection: MonthNavigationDirection.vertical, - monthCellStyle: MonthCellStyle( - textStyle: TextStyle( - fontStyle: FontStyle.normal, - fontSize: 13, - color: Colors.white, - ), - ), ), viewHeaderStyle: const ViewHeaderStyle( dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600), @@ -365,7 +343,7 @@ class _MonthlyAttendanceScreenState extends State { child: Text( "$val", style: const TextStyle( - fontSize: 13, + fontSize: 12, fontWeight: FontWeight.w500, color: MyColors.white, ), @@ -398,8 +376,6 @@ class _MonthlyAttendanceScreenState extends State { ), ); } - - } return Container( margin: const EdgeInsets.all(4), @@ -419,15 +395,11 @@ class _MonthlyAttendanceScreenState extends State { "$val", style: const TextStyle( fontSize: 13, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, color: Color(0xff1F2428), ), ), ); - // return Container( - // alignment: Alignment.center, - // child: Text("$val"), - // ); } else { return const SizedBox(); } @@ -468,11 +440,11 @@ class _MonthlyAttendanceScreenState extends State { return Column( children: [ Container( - width: 75, + width: 49, height: 7, margin: const EdgeInsets.symmetric(vertical: 10), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(25), color: MyColors.darkGreyColor, ), ), @@ -483,196 +455,146 @@ class _MonthlyAttendanceScreenState extends State { itemBuilder: (_, i) => Container( decoration: const BoxDecoration( borderRadius: BorderRadius.vertical( - top: Radius.circular(35.0), + top: Radius.circular(25.0), ), color: MyColors.backgroundBlackColor, ), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white), - ).paddingOnly(top: 26, left: 21, right: 21), - Container( - child: LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor).paddingOnly(left: 21, bottom: 16), - ), - Center( - child: CircularStepProgressBar( - totalSteps: 16 * 4, - currentStep: percentage, - width: 210, - height: 210, - selectedColor: MyColors.gradiantEndColor, - unselectedColor: MyColors.grey70Color, - child: Center( + 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, children: [ "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), - 19.height, + 28.height, LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), ], - ), - ), - ), - ), - Container( - padding: const EdgeInsets.only(top: 20, bottom: 20), - ), + ).center, + ).center, + ], + ).paddingOnly(left: 21, right: 21, top: 27, bottom: 37), Stack( children: [ - Container( - height: 5, - padding: const EdgeInsets.only(top: 24, bottom: 24), - color: MyColors.backgroundBlackColor, - ), 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: 21, right: 21, top: 28, bottom: 24), + 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: [ - Container( - margin: const EdgeInsets.only(right: 30, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.actualCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, - "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) - : "__".toText22(color: Colors.black, isBold: true), - ], - ), - ), - 40.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.actualCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, + 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.whiteColor, + color: MyColors.lightGreyEFColor, ), 25.height, Row( children: [ - Container( - margin: const EdgeInsets.only(right: 30, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.approvedCheckIn.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, - "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" != "" - ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) - : "__".toText22(color: MyColors.greenColor, isBold: true), - ], - ), - ), - 30.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.approvedCheckOut.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, + 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.whiteColor, + color: MyColors.lightGreyEFColor, ), 25.height, Row( children: [ - Container( - margin: const EdgeInsets.only(right: 30, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.lateIn.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, - "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), - ], - ), - ), - 80.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.excess.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, - "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: Colors.black, isBold: true), + 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.whiteColor, + color: MyColors.lightGreyEFColor, ), 25.height, Row( children: [ - Container( - margin: const EdgeInsets.only(right: 30, left: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.shortage.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, - "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true), - ], - ), - ), - 80.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.earlyOut.tr().toText11( - color: MyColors.grey67Color, - ), - 8.height, + 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, ], ), ], diff --git a/lib/ui/my_team/my_team.dart b/lib/ui/my_team/my_team.dart index 0e3aaf5..7b802c1 100644 --- a/lib/ui/my_team/my_team.dart +++ b/lib/ui/my_team/my_team.dart @@ -67,7 +67,7 @@ class _MyTeamState extends State { Row( children: [ TextField( - onChanged: dropdownValue == "Name" + onChanged: dropdownValue == "name" ? (String value) { getEmployeeSListOnSearch = getEmployeeSubordinatesList.where((GetEmployeeSubordinatesList element) => element.eMPLOYEENAME!.toLowerCase().contains(value.toLowerCase())).toList(); @@ -180,8 +180,7 @@ class _MyTeamState extends State { } // todo @fatima add translation for below list - List list = ["Name", "Email"]; - + List list = [LocaleKeys.name.tr(), LocaleKeys.email.tr()]; Widget dropDown() { return PopupMenuButton( itemBuilder: (_) => >[ diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 28ab0f6..d0f9f14 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -88,206 +88,159 @@ class _ViewAttendanceState extends State { title: LocaleKeys.viewAttendance.tr(), ), backgroundColor: MyColors.backgroundColor, - body: SingleChildScrollView( - child: Column(children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 21, - left: 21, - right: 21, - ), - padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15), - // height: 120, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: Column( + body: ListView( + children: [ + Container( + margin: EdgeInsets.all(21), + child: Column( + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.todayAttendance.tr().toText16(isBold: true, color: MyColors.darkColor), - SizedBox( - height: 10, - ), + LocaleKeys.todayAttendance.tr().toText16(color: MyColors.darkTextColor), + 7.height, Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, children: [ - Column( - children: [ - LocaleKeys.checkIn.tr().toText10(isBold: true, color: MyColors.green69Color), - "${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), - ], - ), - Column( - children: [ - LocaleKeys.checkOut.tr().toText10(isBold: true, color: MyColors.redA3Color), - "${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), - ], - ), - Column( + Column( crossAxisAlignment: CrossAxisAlignment.start, + children: [ - LocaleKeys.lateIn.tr().toText10(isBold: true, color: MyColors.darkGreyColor), - "${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText14(isBold: true, color: MyColors.grey57Color), + LocaleKeys.checkIn.tr().toText10(color: MyColors.green69Color), + "${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText14(color: MyColors.grey57Color), ], - ), - ], - ) - ], - ), - ), - Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 18, - left: 18, - right: 18, - bottom: 28, - ), - padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 16), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 26, - offset: Offset(0, 3), - ), - ], - color: Colors.white, - borderRadius: BorderRadius.circular(10.0), - ), - child: Column( - children: [ - //20.height, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + ).expanded, Row( children: [ - "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), - const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), - ], - ).onPress(() async { - showMonthPicker( - context: context, //locale: EasyLocalization.of(context)?.locale, - initialDate: formattedDate, - firstDate: DateTime(searchYear - 2), - lastDate: DateTime.now(), - ).then((selectedDate) { - if (selectedDate != null) { - searchMonth = getMonth(selectedDate.month); - searchYear = selectedDate.year; - formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); - callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); - } - }); - }) - ], - ), - 18.height, - AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()), - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + Container(height: 30, width: 1, color: const Color(0xffF0F0F0)), + 11.width, Column( children: [ - LocaleKeys.attendance.tr().toText12(isBold: true, color: MyColors.grey3AColor), - LocaleKeys.stats.tr().toText24(isBold: true, color: MyColors.grey3AColor), + LocaleKeys.checkOut.tr().toText10(color: MyColors.redA3Color), + "${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText14( color: MyColors.grey57Color), ], ), - 30.height, - Row( + ], + ).expanded, + Row( + children: [ + Container(height: 30, width: 1, color: const Color(0xffF0F0F0)), + 11.width, + Column( children: [ - Container( - height: 8, - width: 8, - decoration: BoxDecoration( - color: MyColors.lightGreenColor, - borderRadius: BorderRadius.circular(100), - ), - ), - Container( - margin: const EdgeInsets.only(left: 5, right: 5), - child: "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16(isBold: true, color: MyColors.lightGreenColor), - ), + LocaleKeys.lateIn.tr().toText10(color: MyColors.darkGreyColor), + "${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText14(color: MyColors.grey57Color), ], ), - 8.height, - Row( - children: [ - Container( - height: 9, - width: 9, - decoration: BoxDecoration( - color: MyColors.backgroundBlackColor, - borderRadius: BorderRadius.circular(100), + ], + ).expanded, + ], + ) + ], + ).paddingOnly(top:15, left: 14, right: 14, bottom: 20).objectContainerView(disablePadding: true, radius: 10,), + 12.height, + Column( + children: [ + Row( + children: [ + "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), + const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), + ], + ).onPress(() async { + showMonthPicker( + context: context, //locale: EasyLocalization.of(context)?.locale, + initialDate: formattedDate, + firstDate: DateTime(searchYear - 2), + lastDate: DateTime.now(), + ).then((selectedDate) { + if (selectedDate != null) { + searchMonth = getMonth(selectedDate.month); + searchYear = selectedDate.year; + formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); + callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); + } + }); + }), + 8.height, + AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()), + // 45.height, + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${LocaleKeys.attendance.tr()} ${LocaleKeys.stats.tr()}".toSectionHeading(), + 29.height, + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.lightGreenColor, + borderRadius: BorderRadius.circular(100), + ), ), - ), - Container( - margin: const EdgeInsets.only(left: 5, right: 5), - child: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16( - isBold: true, - color: MyColors.backgroundBlackColor, + 7.width, + "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16( + isBold: true, color: MyColors.lightGreenColor), + ], + ), + 8.height, + Row( + children: [ + Container( + height: 9, + width: 9, + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + borderRadius: BorderRadius.circular(100), + ), ), - ) - ], - ), - ], - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 170, - height: 170, - child: PieChart( - dataMap: dataMap, - animationDuration: const Duration(milliseconds: 800), - chartLegendSpacing: 0, - chartRadius: MediaQuery.of(context).size.width / 5.2, - colorList: _colorList, - initialAngleInDegree: 0, - chartType: ChartType.ring, - ringStrokeWidth: 80, - legendOptions: const LegendOptions( - showLegendsInRow: false, - showLegends: false, - ), - chartValuesOptions: const ChartValuesOptions( - showChartValueBackground: false, - showChartValues: true, - showChartValuesInPercentage: true, - showChartValuesOutside: false, - decimalPlaces: 1, - chartValueStyle: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: MyColors.white, - )), + 7.width, + "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16( + isBold: true, color: MyColors.backgroundBlackColor, + ) + ], + ), + ], + ).expanded, + 44.width, + AspectRatio(aspectRatio: 1/1, + child: PieChart( + dataMap: dataMap, + animationDuration: const Duration(milliseconds: 800), + chartLegendSpacing: 0, + chartRadius: MediaQuery.of(context).size.width / 5.2, + colorList: _colorList, + initialAngleInDegree: 0, + chartType: ChartType.ring, + ringStrokeWidth: 80, + legendOptions: const LegendOptions( + showLegendsInRow: false, + showLegends: false, ), + chartValuesOptions: const ChartValuesOptions( + showChartValueBackground: false, + showChartValues: true, + showChartValuesInPercentage: true, + showChartValuesOutside: false, + decimalPlaces: 1, + chartValueStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: MyColors.white, + )), ), - ], - ).paddingOnly(left: 21, right: 21, bottom: 21), - ], - ), - ], - ), - ), - ]), + ).expanded, + ], + ), + ], + ).paddingOnly(top:17, left: 14, right: 14, bottom: 35).objectContainerView(disablePadding: true, radius: 10,), + ] + ), + ), + ] ), ); } @@ -315,16 +268,9 @@ class _ViewAttendanceState extends State { dayFormat: 'EEE', showTrailingAndLeadingDates: false, showAgenda: false, - monthCellStyle: MonthCellStyle( - textStyle: TextStyle( - fontStyle: FontStyle.normal, - fontSize: 13, - color: Colors.white, - ), - ), ), viewHeaderStyle: const ViewHeaderStyle( - dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600), + dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 12, fontWeight: FontWeight.w600), ), monthCellBuilder: (build, details) { if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) { @@ -342,7 +288,7 @@ class _ViewAttendanceState extends State { child: Text( "$val", style: const TextStyle( - fontSize: 13, + fontSize: 11, fontWeight: FontWeight.w500, color: MyColors.greyA5Color, ), @@ -373,7 +319,7 @@ class _ViewAttendanceState extends State { child: Text( "$val", style: const TextStyle( - fontSize: 13, + fontSize: 11, fontWeight: FontWeight.w500, color: MyColors.white, ), @@ -399,7 +345,7 @@ class _ViewAttendanceState extends State { child: Text( "$val", style: const TextStyle( - fontSize: 13, + fontSize: 11, fontWeight: FontWeight.w500, color: MyColors.white, ), @@ -424,8 +370,8 @@ class _ViewAttendanceState extends State { child: Text( "$val", style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, + fontSize: 10, + fontWeight: FontWeight.w600, color: Color(0xff1F2428), ), ), diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index 340082c..e68eb92 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -78,47 +78,30 @@ class _FamilyMembersState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ // todo @faitma clean below logic and write clean code. - menuEntries.updateButton == 'Y' - ? InkWell( - onTap: () async { - relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); - showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()); - }, - child: RichText( - text: TextSpan( - children: [ - const WidgetSpan( - child: Icon( - Icons.edit, - size: 15, - color: MyColors.grey67Color, + RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: menuEntries.updateButton == 'Y' + ?InkWell( + onTap: () async { + relationId = getEmployeeContactsList[index]!.cONTACTRELATIONSHIPID!.toInt(); + showUpdateAlertDialog(context, relationId!.toInt(), 2, LocaleKeys.update.tr()); + }, + child: Icon(Icons.edit, size: 14, color: MyColors.grey67Color, ), - ), - TextSpan( - text: LocaleKeys.update.tr(), - style: const TextStyle(color: MyColors.grey67Color, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), - ), - ], - ), - ), - ) - : RichText( - text: TextSpan( - children: [ - const WidgetSpan( - child: Icon( - Icons.edit, - size: 15, - color: MyColors.lightGreyColor, - ), + ) + :Icon(Icons.edit, size: 14, color: MyColors.lightGreyColor, ), - TextSpan( - text: LocaleKeys.update.tr(), - style: const TextStyle(color: MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), - ), - ], - ), + ), + TextSpan( + text: LocaleKeys.update.tr(), + style: menuEntries.updateButton == 'Y'? TextStyle(color: MyColors.grey67Color, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600) + :TextStyle(color: MyColors.lightGreyColor, fontSize: 12, letterSpacing: -0.36, fontWeight: FontWeight.w600), + ), + ], ), + ), Container(height: 35, width: 1, color: const Color(0xffEFEFEF)), InkWell( onTap: () { @@ -130,10 +113,7 @@ class _FamilyMembersState extends State { children: [ const WidgetSpan( child: Icon( - Icons.delete, - size: 15, - color: MyColors.redColor, - ), + Icons.delete, size: 15, color: MyColors.redColor,), ), TextSpan( text: LocaleKeys.remove.tr(),