Merge branch 'development_sikander' into 'master'

monthly attendance fixes.

See merge request mirza.shafique/mohem_flutter_app!76
merge-requests/1/merge
Sikander Saleem 3 years ago
commit ae841e54ea

@ -14,6 +14,7 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart';
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:month_picker_dialog/month_picker_dialog.dart';
import 'package:pie_chart/pie_chart.dart'; import 'package:pie_chart/pie_chart.dart';
@ -28,8 +29,6 @@ class MonthlyAttendanceScreen extends StatefulWidget {
} }
} }
// todo '@fatima' use extension methods for widgets
class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> { class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
bool isPresent = false; bool isPresent = false;
bool isAbsent = false; bool isAbsent = false;
@ -86,29 +85,25 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Map<String, double> dataMap = { Map<String, double> dataMap = {
"Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0, "Present": getTimeCardSummaryList?.aTTENDEDDAYS?.toDouble() ?? 75,
"Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0, "Absent": getTimeCardSummaryList?.aBSENTDAYS?.toDouble() ?? 25,
}; };
return Scaffold( return Scaffold(
backgroundColor: MyColors.backgroundColor, backgroundColor: Colors.white,
appBar: AppBarWidget(
context,
// title: LocaleKeys.mowadhafhiRequest.tr(),
title: "",
// showHomeButton: true,
),
body: ListView( body: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
children: [ children: [
Column( Column(
children: [ children: [
Container( Column(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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), LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.grey3AColor),
Row( Row(
children: [ children: [
@ -133,8 +128,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
18.height, 18.height,
AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()), AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()),
], ],
).paddingOnly(left: 21, right: 21, top:40), ).paddingOnly(left: 21, right: 21, top: 21),
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@ -148,7 +142,10 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
38.height, 38.height,
Container( AspectRatio(
aspectRatio: 375 / 226,
child: Container(
padding: const EdgeInsets.only(top: 28, bottom: 28, left: 21, right: 21),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
@ -159,7 +156,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
BoxShadow( BoxShadow(
offset: const Offset(0, 1), offset: const Offset(0, 1),
blurRadius: 26, blurRadius: 26,
color: Color(0xff000014).withOpacity(0.1), color: MyColors.darkColor.withOpacity(0.1),
), ),
], ],
), ),
@ -181,8 +178,8 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
), ),
), ),
7.width, 7.width,
"${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16( "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}"
isBold: true, color: MyColors.lightGreenColor), .toText16(isBold: true, color: MyColors.lightGreenColor),
], ],
), ),
8.height, 8.height,
@ -197,23 +194,27 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
), ),
), ),
7.width, 7.width,
"${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16( "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0}".toText16(
isBold: true, color: MyColors.backgroundBlackColor, isBold: true,
color: MyColors.backgroundBlackColor,
) )
], ],
), ),
], ],
).expanded, ).expanded,
44.width, //44.width,
AspectRatio(aspectRatio: 1/1, SizedBox(
height: 170,
width: 170,
child: PieChart( child: PieChart(
dataMap: dataMap, dataMap: dataMap,
animationDuration: const Duration(milliseconds: 800), animationDuration: const Duration(milliseconds: 800),
chartLegendSpacing: 0, chartLegendSpacing: 0,
chartRadius: MediaQuery.of(context).size.width / 5.2, chartRadius: MediaQuery.of(context).size.width / 5.2,
colorList: _colorList, colorList: _colorList,
initialAngleInDegree: 0, initialAngleInDegree: 270,
chartType: ChartType.ring, chartType: ChartType.ring,
emptyColor: MyColors.greyACColor,
ringStrokeWidth: 80, ringStrokeWidth: 80,
legendOptions: const LegendOptions( legendOptions: const LegendOptions(
showLegendsInRow: false, showLegendsInRow: false,
@ -223,17 +224,20 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
showChartValueBackground: false, showChartValueBackground: false,
showChartValues: true, showChartValues: true,
showChartValuesInPercentage: true, showChartValuesInPercentage: true,
showChartValuesOutside: false, showChartValuesOutside: true,
decimalPlaces: 1, decimalPlaces: 0,
chartValueStyle: TextStyle( chartValueStyle: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
letterSpacing: -0.64,
color: MyColors.white, color: MyColors.white,
)),
), ),
).expanded, ),
),
),
], ],
).paddingOnly(left: 21, right: 21, top: 29, bottom: 28), ),
),
), ),
], ],
), ),
@ -298,29 +302,24 @@ 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;
//check day is off //check day is off
if(getDayHoursTypeDetailsList.isNotEmpty) if (getDayHoursTypeDetailsList.isNotEmpty) {
bool isDayIsOff = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF';
bool isDayIsPresent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y';
bool isDayIsAbsent = getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y';
{ if (isDayIsOff) {
if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].dAYTYPE == 'OFF') {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(color: MyColors.greyACColor.withOpacity(.12), shape: BoxShape.circle),
color: MyColors.greyACColor.withOpacity(.12),
shape: BoxShape.circle,
),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"$val", "$val",
style: const TextStyle( style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: MyColors.greyA5Color),
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.greyA5Color,
),
), ),
); );
} }
//check day is Present //check day is Present
else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'Y') { else if (isDayIsPresent) {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -342,16 +341,12 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"$val", "$val",
style: const TextStyle( style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: MyColors.white),
fontSize: 12,
fontWeight: FontWeight.w500,
color: MyColors.white,
),
), ),
); );
} }
//check day is Absent //check day is Absent
else if (getDayHoursTypeDetailsList?[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList?[val - 1].aBSENTFLAG == 'Y') { else if (isDayIsAbsent) {
return Container( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -368,11 +363,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"$val", "$val",
style: const TextStyle( style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: MyColors.white),
fontSize: 13,
fontWeight: FontWeight.w500,
color: MyColors.white,
),
), ),
); );
} }
@ -395,7 +386,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
"$val", "$val",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
color: Color(0xff1F2428), color: Color(0xff1F2428),
), ),
), ),
@ -491,8 +482,7 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
decoration: const BoxDecoration( decoration: const BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(25), topRight: Radius.circular(25)), color: Colors.white),
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: [
@ -501,7 +491,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.actualCheckIn.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.actualCheckIn.tr().toText11(
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),
@ -510,7 +502,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.actualCheckOut.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.actualCheckOut.tr().toText11(
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),
@ -530,7 +524,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.approvedCheckIn.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.approvedCheckIn.tr().toText11(
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),
@ -539,7 +535,9 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.approvedCheckOut.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.approvedCheckOut.tr().toText11(
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),
@ -559,14 +557,18 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.lateIn.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.lateIn.tr().toText11(
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(color: MyColors.grey67Color,), LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true), "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: MyColors.backgroundBlackColor, isBold: true),
], ],
).expanded, ).expanded,
@ -584,14 +586,18 @@ class _MonthlyAttendanceScreenState extends State<MonthlyAttendanceScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.shortage.tr().toText11(color: MyColors.grey67Color,), LocaleKeys.shortage.tr().toText11(
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(color: MyColors.grey67Color,), LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color,
),
"${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true),
], ],
).expanded, ).expanded,

@ -35,8 +35,8 @@ class _ViewAttendanceState extends State<ViewAttendance> {
int searchYear = DateTime.now().year; int searchYear = DateTime.now().year;
int? pRTPID; int? pRTPID;
String searchEmpEmail =""; String searchEmpEmail = "";
String searchEmpName =""; String searchEmpName = "";
String searchEmpNo = ""; String searchEmpNo = "";
String? empId; String? empId;
List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = []; List<GetEmployeeSubordinatesList> getEmployeeSubordinatesList = [];
@ -52,12 +52,11 @@ class _ViewAttendanceState extends State<ViewAttendance> {
callTimeCardAndHourDetails(date.day, searchMonth, searchYear); callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
} }
void callTimeCardAndHourDetails(index, searchMonth, searchYear) async { void callTimeCardAndHourDetails(index, searchMonth, searchYear) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString()); getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString());
getTimeCardSummaryList = await MyTeamApiClient().getTimeCardSummary(searchMonth, searchYear,getEmployeeSubordinates?.eMPLOYEENUMBER); getTimeCardSummaryList = await MyTeamApiClient().getTimeCardSummary(searchMonth, searchYear, getEmployeeSubordinates?.eMPLOYEENUMBER);
getDayHoursTypeDetailsList = await MyTeamApiClient().getDayHoursTypeDetails(searchMonth, searchYear, getEmployeeSubordinates?.eMPLOYEENUMBER); getDayHoursTypeDetailsList = await MyTeamApiClient().getDayHoursTypeDetails(searchMonth, searchYear, getEmployeeSubordinates?.eMPLOYEENUMBER);
attendanceTracking = await MyTeamApiClient().getAttendanceTracking(getEmployeeSubordinates?.eMPLOYEENUMBER); attendanceTracking = await MyTeamApiClient().getAttendanceTracking(getEmployeeSubordinates?.eMPLOYEENUMBER);
Utils.hideLoading(context); Utils.hideLoading(context);
@ -69,8 +68,6 @@ class _ViewAttendanceState extends State<ViewAttendance> {
} }
} }
final CalendarController _calendarController = CalendarController(); final CalendarController _calendarController = CalendarController();
final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)]; final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)];
@ -103,11 +100,11 @@ class _ViewAttendanceState extends State<ViewAttendance> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Column( crossAxisAlignment: CrossAxisAlignment.start, Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.checkIn.tr().toText10(color: MyColors.green69Color), LocaleKeys.checkIn.tr().toText10(color: MyColors.green69Color),
"${(attendanceTracking?.pSwipeIn)?? "- - : - -"}".toText14(color: MyColors.grey57Color), "${(attendanceTracking?.pSwipeIn) ?? "- - : - -"}".toText14(color: MyColors.grey57Color),
], ],
).expanded, ).expanded,
Row( Row(
@ -117,7 +114,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
Column( Column(
children: [ children: [
LocaleKeys.checkOut.tr().toText10(color: MyColors.redA3Color), LocaleKeys.checkOut.tr().toText10(color: MyColors.redA3Color),
"${(attendanceTracking?.pSwipeOut)?? "- - : - -"}".toText14( color: MyColors.grey57Color), "${(attendanceTracking?.pSwipeOut) ?? "- - : - -"}".toText14(color: MyColors.grey57Color),
], ],
), ),
], ],
@ -129,7 +126,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
Column( Column(
children: [ children: [
LocaleKeys.lateIn.tr().toText10(color: MyColors.darkGreyColor), LocaleKeys.lateIn.tr().toText10(color: MyColors.darkGreyColor),
"${(attendanceTracking?.pLateInHours)?? "- - : - -"}".toText14(color: MyColors.grey57Color), "${(attendanceTracking?.pLateInHours) ?? "- - : - -"}".toText14(color: MyColors.grey57Color),
], ],
), ),
], ],
@ -137,7 +134,10 @@ class _ViewAttendanceState extends State<ViewAttendance> {
], ],
) )
], ],
).paddingOnly(top:15, left: 14, right: 14, bottom: 20).objectContainerView(disablePadding: true, radius: 10,), ).paddingOnly(top: 15, left: 14, right: 14, bottom: 20).objectContainerView(
disablePadding: true,
radius: 10,
),
12.height, 12.height,
Column( Column(
children: [ children: [
@ -146,21 +146,25 @@ class _ViewAttendanceState extends State<ViewAttendance> {
"${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor), "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.grey3AColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor), const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.grey3AColor),
], ],
).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(),
).then((selectedDate) { ).then(
(selectedDate) {
if (selectedDate != null) { if (selectedDate != null) {
searchMonth = getMonth(selectedDate.month); searchMonth = getMonth(selectedDate.month);
searchYear = selectedDate.year; searchYear = selectedDate.year;
formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate);
callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear);
} }
}); },
}), );
},
),
8.height, 8.height,
AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()), AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()),
// 45.height, // 45.height,
@ -182,8 +186,7 @@ class _ViewAttendanceState extends State<ViewAttendance> {
), ),
), ),
7.width, 7.width,
"${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList?.aTTENDEDDAYS : 0}".toText16( "${LocaleKeys.present.tr()} ${getTimeCardSummaryList?.aTTENDEDDAYS ?? 0}".toText16(isBold: true, color: MyColors.lightGreenColor),
isBold: true, color: MyColors.lightGreenColor),
], ],
), ),
8.height, 8.height,
@ -198,15 +201,17 @@ class _ViewAttendanceState extends State<ViewAttendance> {
), ),
), ),
7.width, 7.width,
"${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList?.aBSENTDAYS : 0 }".toText16( "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList?.aBSENTDAYS ?? 0}".toText16(
isBold: true, color: MyColors.backgroundBlackColor, isBold: true,
color: MyColors.backgroundBlackColor,
) )
], ],
), ),
], ],
).expanded, ).expanded,
44.width, 44.width,
AspectRatio(aspectRatio: 1/1, AspectRatio(
aspectRatio: 1 / 1,
child: PieChart( child: PieChart(
dataMap: dataMap, dataMap: dataMap,
animationDuration: const Duration(milliseconds: 800), animationDuration: const Duration(milliseconds: 800),
@ -236,11 +241,11 @@ class _ViewAttendanceState extends State<ViewAttendance> {
], ],
), ),
], ],
).paddingOnly(top:17, left: 14, right: 14, bottom: 35).objectContainerView(disablePadding: true, radius: 10,), ).paddingOnly(top: 17, left: 14, right: 14, bottom: 35).objectContainerView(disablePadding: true, radius: 10),
] ],
), ),
), ),
] ],
), ),
); );
} }
@ -383,7 +388,6 @@ class _ViewAttendanceState extends State<ViewAttendance> {
); );
} }
List<Meeting> _getDataSource() { List<Meeting> _getDataSource() {
List<Meeting> meetings = <Meeting>[]; List<Meeting> meetings = <Meeting>[];
return meetings; return meetings;

Loading…
Cancel
Save