diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 9efc35d..7a65f43 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -24,7 +24,7 @@ "checkIn": "تحقق في", "workList": "قائمة العمل", "leaveBalance": "رصيد الاجازات", - "missingSwipes": "الضربات الشديدة في عداد المفقودين", + "missingSwipes": "تسجيل بصمة حضور", "ticketBalance": "رصيد التذكرة", "other": "آخر", "services": "خدمات", @@ -56,10 +56,10 @@ "order": "الطلبات", "earlyOut": "الخروج مبكرا", "shortage": "ساعات التقصير", - "excess": "Excess", + "excess": "فائض", "lateIn": "القدوم المتاخر", - "approvedCheckOut": "وقت الخروج", - "approvedCheckIn": "وقت الدخول", + "approvedCheckOut": "اعتماد وقت الخروج", + "approvedCheckIn": "اعتماد وقت الدخول", "actualCheckOut": "وقت الخروج", "actualCheckIn": "وقت الدخول", "present": "حضور", @@ -229,7 +229,7 @@ "approvalLevel": "مستوى الموافقة", "requesterDetails": "تفاصيل مقدم الطلب", "myAttendance": "حضوري", - "workOnBreak": "العمل على استراحة", + "workOnBreak": "التعويض عن العمل اثناءالاستراحه", "next": "التالي", "completingYear": "نحن نقدر لك لاستكمال خدمة", "year": "سنة", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index dd2d2a4..07e8546 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -62,10 +62,10 @@ "approvedCheckIn": "Approved Check In", "actualCheckOut": "Actual Check Out", "actualCheckIn": "Actual Check In", - "present": "PRESENT 11", + "present": "PRESENT", "pres": "present", "shiftTime": "Shift Time", - "absent": "ABSENT 10", + "absent": "ABSENT", "attendance": "Attendance", "scheduleDays": "Schedule\nDays", "offDays": "Off\nDays", @@ -244,8 +244,9 @@ "dateOfBirth" : "Date of Birth", "maritalStatus ": "Marital Status ", "fullName": "Full Name", - "remove": "remove", - "update": "update", + "remove": "Remove", + "update": "Update", + "Attendance":"Attendance", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/api/monthlyAttendance_api_client.dart b/lib/api/monthlyAttendance_api_client.dart index 4f6aca7..bcbf69f 100644 --- a/lib/api/monthlyAttendance_api_client.dart +++ b/lib/api/monthlyAttendance_api_client.dart @@ -26,9 +26,11 @@ class MonthlyAttendanceApiClient { "SearchMonth": month, "SearchYear": year, }; + postParams.addAll(AppState().postParamsJson); return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); + print(responseData); return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null; }, url, postParams); } @@ -48,7 +50,6 @@ class MonthlyAttendanceApiClient { // postParams["DeviceType"] = deviceType; return await ApiClient().postJsonForObject((json) { GenericResponseModel? responseData = GenericResponseModel.fromJson(json); - print("Response Data______"); print(responseData.getDayHoursTypeDetailsList!.length); return responseData.getDayHoursTypeDetailsList ?? []; }, url, postParams); diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 5e6c80e..2baa9d2 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -40,7 +40,7 @@ class CodegenLoader extends AssetLoader{ "checkIn": "تحقق في", "workList": "قائمة العمل", "leaveBalance": "رصيد الاجازات", - "missingSwipes": "الضربات الشديدة في عداد المفقودين", + "missingSwipes": "تسجيل بصمة حضور", "ticketBalance": "رصيد التذكرة", "other": "آخر", "services": "خدمات", @@ -72,10 +72,10 @@ class CodegenLoader extends AssetLoader{ "order": "الطلبات", "earlyOut": "الخروج مبكرا", "shortage": "ساعات التقصير", - "excess": "Excess", + "excess": "فائض", "lateIn": "القدوم المتاخر", - "approvedCheckOut": "وقت الخروج", - "approvedCheckIn": "وقت الدخول", + "approvedCheckOut": "اعتماد وقت الخروج", + "approvedCheckIn": "اعتماد وقت الدخول", "actualCheckOut": "وقت الخروج", "actualCheckIn": "وقت الدخول", "present": "حضور", @@ -245,7 +245,7 @@ class CodegenLoader extends AssetLoader{ "approvalLevel": "مستوى الموافقة", "requesterDetails": "تفاصيل مقدم الطلب", "myAttendance": "حضوري", - "workOnBreak": "العمل على استراحة", + "workOnBreak": "التعويض عن العمل اثناءالاستراحه", "next": "التالي", "completingYear": "نحن نقدر لك لاستكمال خدمة", "year": "سنة", @@ -340,7 +340,7 @@ static const Map en_US = { "setTheNewPassword": "Set the new password", "typeYourNewPasswordBelow": "Type your new password below", "confirmPassword": "Confirm Password", - "update": "update", + "update": "Update", "title": "Title", "home": "Home", "mySalary": "My Salary", @@ -363,10 +363,10 @@ static const Map en_US = { "approvedCheckIn": "Approved Check In", "actualCheckOut": "Actual Check Out", "actualCheckIn": "Actual Check In", - "present": "PRESENT 11", + "present": "PRESENT", "pres": "present", "shiftTime": "Shift Time", - "absent": "ABSENT 10", + "absent": "ABSENT", "attendance": "Attendance", "scheduleDays": "Schedule\nDays", "offDays": "Off\nDays", @@ -544,7 +544,8 @@ static const Map en_US = { "dateOfBirth": "Date of Birth", "maritalStatus ": "Marital Status ", "fullName": "Full Name", - "remove": "remove", + "remove": "Remove", + "Attendance": "Attendance", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/main.dart b/lib/main.dart index 9952762..50f7daf 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,6 +11,7 @@ import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; import 'package:mohem_flutter_app/provider/eit_provider_model.dart'; import 'package:mohem_flutter_app/theme/app_theme.dart'; import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.dart'; +import 'package:month_year_picker/month_year_picker.dart'; import 'package:nfc_manager/nfc_manager.dart'; import 'package:nfc_manager/platform_tags.dart'; import 'package:provider/provider.dart'; @@ -30,7 +31,7 @@ Future main() async { await EasyLocalization.ensureInitialized(); await Firebase.initializeApp(); AppState().setPostParamsModel( - PostParamsModel(channel: 31, versionID: 3.4, mobileType: Platform.isAndroid ? "android" : "ios"), + PostParamsModel(channel: 31, versionID: 4.0, mobileType: Platform.isAndroid ? "android" : "ios"), ); runApp( EasyLocalization( @@ -68,12 +69,22 @@ class MyApp extends StatelessWidget { builder: (context, orientation, deviceType) { print(AppState().postParamsObject?.toJson()); var obj = AppState().postParamsObject; - obj?.languageID = EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2; + obj?.languageID = EasyLocalization + .of(context) + ?.locale + .languageCode == "ar" ? 1 : 2; AppState().setPostParamsModel(obj!); + List delegates = context.localizationDelegates; + // delegates.add(GlobalMaterialLocalizations.delegate); + delegates.add(MonthYearPickerLocalizations.delegate,); return MaterialApp( - theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"), + theme: AppTheme.getTheme(EasyLocalization + .of(context) + ?.locale + .languageCode == "ar"), debugShowCheckedModeBanner: false, - localizationsDelegates: context.localizationDelegates, + localizationsDelegates + :delegates, supportedLocales: context.supportedLocales, locale: context.locale, initialRoute: AppRoutes.initialRoute, diff --git a/lib/models/get_day_hours_type_details_list_model.dart b/lib/models/get_day_hours_type_details_list_model.dart index 5d0a0ab..daaac74 100644 --- a/lib/models/get_day_hours_type_details_list_model.dart +++ b/lib/models/get_day_hours_type_details_list_model.dart @@ -1,14 +1,14 @@ class GetDayHoursTypeDetailsList { - Null? aBSENCEATTENDANCEID; - Null? aBSENCEATTENDANCETYPEID; + dynamic? aBSENCEATTENDANCEID; + dynamic? aBSENCEATTENDANCETYPEID; String? aBSENTFLAG; String? aCTUALHRS; String? aNALAYZEDFLAG; String? aPPROVEDTIMEBACKHRS; String? aPPRTIMEBACKFLAG; - int? aSSIGNMENTID; + dynamic? aSSIGNMENTID; String? aTTENDEDFLAG; - Null? cALENDARENTRYID; + dynamic? cALENDARENTRYID; String? cOMPOFFFLAG; String? cOMPOFFHRS; String? cOMPOFFHHRS; @@ -19,18 +19,18 @@ class GetDayHoursTypeDetailsList { String? eARLYOUTHRS; String? eXCESSFLAG; String? eXCESSHRS; - int? fROMROWNUM; + dynamic? fROMROWNUM; String? lATEINFLAG; String? lATEINHRS; String? mISSINGSWIPEFLAG; String? nONSCHEDULEDFLAG; - Null? nOOFROWS; + dynamic? nOOFROWS; String? oNCALLHRS; - Null? pERSONEXTRAINFOID; + dynamic? pERSONEXTRAINFOID; String? pLANNEDOTHRS; String? pLANNEDOTHRSFLAG; String? rEMARKS; - int? rOWNUM; + dynamic? rOWNUM; int? rTPID; String? sCHEDULEDHRS; String? sCHEDULEDONCALLHRS; @@ -40,7 +40,7 @@ class GetDayHoursTypeDetailsList { String? sHORTAGEHRS; String? tIMEBACKFLAG; String? tIMEBACKHRS; - int? tOROWNUM; + dynamic? tOROWNUM; GetDayHoursTypeDetailsList( {this.aBSENCEATTENDANCEID, diff --git a/lib/models/get_time_card_summary_list_model.dart b/lib/models/get_time_card_summary_list_model.dart index 6799bfa..727e29f 100644 --- a/lib/models/get_time_card_summary_list_model.dart +++ b/lib/models/get_time_card_summary_list_model.dart @@ -2,39 +2,39 @@ class GetTimeCardSummaryList { int? aBSENTDAYS; - int? aCTUALHRS; - int? aPPROVEDTIMEBACKHRS; + dynamic? aCTUALHRS; + dynamic? aPPROVEDTIMEBACKHRS; int? aSSIGNMENTID; int? aTTENDEDDAYS; int? bUSINESSTRIP; - int? cOMPOFFHHRS; - int? cOMPOFFNHRS; - int? cOMPOFFWHRS; - int? dESIREDSCHEDULEDHRS; - int? eARLYOUTHRS; - int? eXCESSHRS; + dynamic? cOMPOFFHHRS; + dynamic? cOMPOFFNHRS; + dynamic? cOMPOFFWHRS; + dynamic? dESIREDSCHEDULEDHRS; + dynamic? eARLYOUTHRS; + dynamic? eXCESSHRS; int? hALFDAYLEAVE; - int? lATEINHRS; - int? lEAVESHOLIDAYSHRS; - int? nONSCHEDULEDAYS; - int? nOTANALYZEDDAYS; + dynamic? lATEINHRS; + dynamic? lEAVESHOLIDAYSHRS; + dynamic? nONSCHEDULEDAYS; + dynamic? nOTANALYZEDDAYS; int? oFFDAYS; - int? oNCALLHRS; - int? pAIDLEAVE; + dynamic? oNCALLHRS; + dynamic? pAIDLEAVE; int? pERIODDAYS; - int? pLANNEDOTHRS; + dynamic? pLANNEDOTHRS; int? pUBLICHOLIDAY; - int? sCHEDULEDHRS; - int? sCHEDULEDONCALLHRS; - int? sCHEDULEDPLANNEDOTHRS; + dynamic? sCHEDULEDHRS; + dynamic? sCHEDULEDONCALLHRS; + dynamic? sCHEDULEDPLANNEDOTHRS; int? sCHEDULEDAYS; - int? sHORTAGEHRS; - int? sHORTAGESCHEDULEHRS; + dynamic? sHORTAGEHRS; + dynamic? sHORTAGESCHEDULEHRS; int? sICKLEAVE; - int? tIMEBACKHRS; - double? tIMEBACKBALANCE; + dynamic? tIMEBACKHRS; + dynamic? tIMEBACKBALANCE; int? uNAUTHORIZEDLEAVE; - int? uNCOVERDSHORTAGEHRS; + dynamic? uNCOVERDSHORTAGEHRS; int? uNPAIDLEAVE; GetTimeCardSummaryList( diff --git a/lib/ui/attendance/monthly_attendance.dart b/lib/ui/attendance/monthly_attendance.dart index 7391211..5ba0937 100644 --- a/lib/ui/attendance/monthly_attendance.dart +++ b/lib/ui/attendance/monthly_attendance.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/src/public_ext.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; +import 'package:flutter/scheduler.dart'; import 'package:mohem_flutter_app/api/monthlyAttendance_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; @@ -17,6 +18,10 @@ import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:flutter/cupertino.dart'; import 'package:pie_chart/pie_chart.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:intl/intl.dart'; +import 'package:month_year_picker/month_year_picker.dart'; +import 'package:month_picker_dialog/month_picker_dialog.dart'; class MonthlyAttendance extends StatefulWidget { MonthlyAttendance({Key? key}) : super(key: key); @@ -28,12 +33,12 @@ class MonthlyAttendance extends StatefulWidget { } class _MonthlyAttendanceState extends State { - bool isPresent = true; - bool isAbsent = true; - bool isMissingDays = true; - bool isOffDays = true; + bool isPresent = false; + bool isAbsent = false; + bool isMissing = false; + bool isOff = false; DateTime date = DateTime.now(); - late var formattedDate; + late DateTime formattedDate; var currentMonth = DateTime.now().month; String searchMonth = getMonth(DateTime.now().month); int searchYear = DateTime.now().year; @@ -41,84 +46,42 @@ class _MonthlyAttendanceState extends State { List getDayHoursTypeDetailsList = []; GetTimeCardSummaryList? getTimeCardSummaryList; - - // GetDayHoursTypeDetailsList? getDayHoursTypeDetailsList; GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList; @override void initState() { super.initState(); - getTimeCardSummary(searchMonth, searchYear); - getDayHoursTypeDetails(date.day, searchMonth, searchYear); - formattedDate = DateFormat('MMM-yyyy').format(date); + formattedDate = date; + callTimeCardAndHourDetails(date.day, searchMonth, searchYear); } - void getTimeCardSummary(searchMonth, searchYear) async { + void callTimeCardAndHourDetails(index, searchMonth, searchYear) async { try { Utils.showLoading(context); getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); - Utils.hideLoading(context); - setState(() {}); - } catch (ex) { - Utils.hideLoading(context); - Utils.handleException(ex, context, null); - } - } - - void getDayHoursTypeDetails(index, searchMonth, searchYear) async { - try { - Utils.showLoading(context); getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear); Utils.hideLoading(context); - pRTPID = getDayHoursTypeDetailsList[index].rTPID; + _calendarController.displayDate = formattedDate; setState(() {}); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); } - countAllAttendDays(); - getScheduleShiftsDetails(pRTPID); } - getScheduleShiftsDetails(pRTPID) async { + + Future getScheduleShiftsDetails(index, pRTPID) async { try { Utils.showLoading(context); getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID); Utils.hideLoading(context); - setState(() {}); + //setState(() {}); } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); } } - countAllAttendDays() { - // print(getDayHoursTypeDetailsList.length); - for (int i = 0; i < getDayHoursTypeDetailsList.length; i++) { - if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'Y') { - isPresent = true; - isAbsent = false; - isMissingDays = false; - isOffDays = false; - } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].aBSENTFLAG == 'Y') { - isPresent = false; - isAbsent = true; - isMissingDays = false; - isOffDays = false; - } else if (getDayHoursTypeDetailsList[i].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[i].dAYTYPE == 'OFF') { - isPresent = false; - isAbsent = false; - isMissingDays = false; - isOffDays = true; - } else { - isPresent = false; - isAbsent = false; - isMissingDays = true; - isOffDays = false; - } - } - } - final CalendarController _calendarController = CalendarController(); final List _colorList = [Color(0xff2AB2AB), Color(0xff202529)]; @@ -126,8 +89,8 @@ class _MonthlyAttendanceState extends State { @override Widget build(BuildContext context) { Map dataMap = { - "Present": getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble(), - "Absent": getTimeCardSummaryList!.aBSENTDAYS!.toDouble(), + "Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0, + "Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0, }; return Scaffold( appBar: AppBar( @@ -150,61 +113,42 @@ class _MonthlyAttendanceState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Attendance".toText24(isBold: true, color: MyColors.darkIconColor), + LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.darkIconColor), Row( children: [ - Text(formattedDate), + "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.greyACColor), const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), ], ).onPress(() async { - await showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2021), + showMonthPicker( + context: context, //locale: EasyLocalization.of(context)?.locale, + initialDate: formattedDate, + firstDate: DateTime(searchYear - 2), lastDate: DateTime.now(), - builder: (context, child) { - return Theme( - data: ThemeData.dark().copyWith( - colorScheme: const ColorScheme.dark( - primary: MyColors.lightGreenColor, - onPrimary: MyColors.white, - surface: MyColors.lightGreenColor, - onSurface: MyColors.darkTextColor, - ), - dialogBackgroundColor: Colors.white, - ), - child: child!, - ); - }, ).then((selectedDate) { if (selectedDate != null) { - var selectedMonth = DateFormat('MMMM').format(selectedDate); - var selectedYear = DateFormat('yyyy').format(selectedDate); - searchMonth = selectedMonth; - searchYear = int.parse(selectedYear); - setState(() { - // date = selectedDate; - formattedDate = DateFormat('MMMM-yyyy').format(selectedDate); - getTimeCardSummary(searchMonth, searchYear); - getDayHoursTypeDetails(selectedDate.day, searchMonth, searchYear); - }); + 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), + AspectRatio(aspectRatio: 333 / 270, child: calendarWidget()).paddingOnly(left: 18, right: 25), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - optionUI("Schedule\nDays", "${getTimeCardSummaryList!.sCHEDULEDAYS}"), + optionUI(LocaleKeys.scheduleDays.tr(), "${getTimeCardSummaryList?.sCHEDULEDAYS}"), 6.width, - optionUI("Off\nDays", "${getTimeCardSummaryList!.oFFDAYS}"), + optionUI(LocaleKeys.offDays.tr(), "${getTimeCardSummaryList?.oFFDAYS}"), 6.width, - optionUI("Non\nAnalyzed", "${getTimeCardSummaryList!.uNAUTHORIZEDLEAVE}"), + optionUI(LocaleKeys.nonAnalyzed.tr(), "${getTimeCardSummaryList?.uNAUTHORIZEDLEAVE}"), 6.width, - optionUI("Shortage\nHour", "${getTimeCardSummaryList!.sHORTAGEHRS}"), + optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS}"), ], ).paddingOnly(left: 21, right: 21), 35.height, @@ -229,10 +173,10 @@ class _MonthlyAttendanceState extends State { children: [ Column( children: [ - "Attendance".toText12(isBold: true, color: MyColors.grey3AColor), - "Stats".toText24(isBold: true, color: MyColors.grey3AColor), + 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), + ).paddingOnly(left: 21, top: 29, bottom: 36, right: 23), Row( children: [ Container( @@ -245,7 +189,7 @@ class _MonthlyAttendanceState extends State { ), Container( margin: const EdgeInsets.only(left: 5, right: 5), - child: "PRESENT ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor), + child: "${LocaleKeys.present.tr()} ${getTimeCardSummaryList!.aTTENDEDDAYS}".toText16(isBold: true, color: MyColors.lightGreenColor), ), ], ).paddingOnly(left: 21, right: 23), @@ -262,13 +206,13 @@ class _MonthlyAttendanceState extends State { ), Container( margin: const EdgeInsets.only(left: 5, right: 5), - child: "ABSENT ${getTimeCardSummaryList!.aBSENTDAYS}".toText16( + child: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList!.aBSENTDAYS}".toText16( isBold: true, color: MyColors.backgroundBlackColor, ), ) ], - ).paddingOnly(left: 21, top: 8), + ).paddingOnly(left: 21, top: 8, right: 23), ], ), Column( @@ -342,70 +286,116 @@ class _MonthlyAttendanceState extends State { Widget calendarWidget() { return SfCalendar( view: CalendarView.month, - // onViewChanged: viewChanged, + showDatePickerButton: false, controller: _calendarController, headerHeight: 0, todayHighlightColor: MyColors.grey3AColor, + showNavigationArrow: false, + showCurrentTimeIndicator: false, + showWeekNumber: false, + cellBorderColor: Colors.white, + selectionDecoration: BoxDecoration( + border: Border.all(color: MyColors.white, width: 10), + borderRadius: const BorderRadius.all(Radius.circular(100)), + shape: BoxShape.circle, + ), + dataSource: MeetingDataSource(_getDataSource()), + onTap: calendarTapped, + monthViewSettings: const MonthViewSettings( + dayFormat: 'EEE', + showTrailingAndLeadingDates: false, + showAgenda: false, + navigationDirection: MonthNavigationDirection.horizontal, + 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), ), - monthCellBuilder: (cxt, build) { - int val = build.date.day; - val == countAllAttendDays(); - if (isPresent) { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - gradient: const LinearGradient( - transform: GradientRotation(.46), - begin: Alignment.topRight, - end: Alignment.bottomLeft, - colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], + monthCellBuilder: (build, details) { + if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) { + int val = details.date.day; + //check day is off + if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.greyACColor.withOpacity(.12), + shape: BoxShape.circle, ), - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - offset: const Offset(0, 2), - blurRadius: 26, - color: MyColors.blackColor.withOpacity(0.100), + alignment: Alignment.center, + child: Text( + "${val}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.greyA5Color, ), - ], - ), - alignment: Alignment.center, - child: Text( - "${build.date.day}", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.white, ), - ), - ); - } else if (isAbsent) { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: MyColors.backgroundBlackColor, - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - offset: const Offset(0, 2), - blurRadius: 26, - color: MyColors.blackColor.withOpacity(0.100), + ); + } + //check day is Present + else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor], ), - ], - ), - alignment: Alignment.center, - child: Text( - "${build.date.day}", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.white, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], ), - ), - ); - } else if (isMissingDays) { + alignment: Alignment.center, + child: Text( + "${val}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } + //check day is Absent + else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].aBSENTFLAG == 'Y') { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: MyColors.backgroundBlackColor, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + offset: const Offset(0, 2), + blurRadius: 26, + color: MyColors.blackColor.withOpacity(0.100), + ), + ], + ), + alignment: Alignment.center, + child: Text( + "${val}", + style: const TextStyle( + fontSize: 13, + fontWeight: FontWeight.w500, + color: MyColors.white, + ), + ), + ); + } return Container( margin: const EdgeInsets.all(4), decoration: BoxDecoration( @@ -421,7 +411,7 @@ class _MonthlyAttendanceState extends State { ), alignment: Alignment.center, child: Text( - "${build.date.day}", + "${val}", style: const TextStyle( fontSize: 13, fontWeight: FontWeight.w500, @@ -429,66 +419,35 @@ class _MonthlyAttendanceState extends State { ), ), ); - } else if (isOffDays) { - return Container( - margin: const EdgeInsets.all(4), - decoration: BoxDecoration( - color: MyColors.greyACColor.withOpacity(.12), - shape: BoxShape.circle, - ), - alignment: Alignment.center, - child: Text( - "${build.date.day}", - style: const TextStyle( - fontSize: 13, - fontWeight: FontWeight.w500, - color: MyColors.greyA5Color, - ), - ), - ); + // return Container( + // alignment: Alignment.center, + // child: Text("$val"), + // ); } else { - return Container(); + return const SizedBox(); } }, - monthViewSettings: const MonthViewSettings( - dayFormat: 'EEE', - showTrailingAndLeadingDates: false, - appointmentDisplayMode: MonthAppointmentDisplayMode.appointment, - showAgenda: false, - navigationDirection: MonthNavigationDirection.horizontal, - monthCellStyle: MonthCellStyle( - textStyle: TextStyle( - fontStyle: FontStyle.normal, - fontSize: 13, - color: Colors.white, - ), - ), - ), - showNavigationArrow: false, - showDatePickerButton: false, - showCurrentTimeIndicator: false, - showWeekNumber: false, - cellBorderColor: Colors.white, - selectionDecoration: BoxDecoration( - border: Border.all(color: MyColors.white, width: 10), - borderRadius: const BorderRadius.all(Radius.circular(100)), - shape: BoxShape.circle, - ), - dataSource: MeetingDataSource(_getDataSource()), - onTap: calendarTapped, ); } - calendarTapped(CalendarTapDetails details) { - dynamic string = getScheduleShiftsDetailsList!.pERCENTAGE; - dynamic percentage = string!.indexOf('%'); - print(percentage); - print(details.date?.day.toString()); - int? index = details.date?.day; + calendarTapped(CalendarTapDetails details) async { + dynamic index = details.date?.day; if (index != null) { index = index - 1; } - getDayHoursTypeDetails(index, getMonth(details.date!.month), details.date?.year); + pRTPID = getDayHoursTypeDetailsList[index].rTPID; + await getScheduleShiftsDetails(index, pRTPID); + dynamic value = getScheduleShiftsDetailsList!.pERCENTAGE; + dynamic percentage; + if (value!.indexOf('%') == 3) { + percentage = int.parse(value!.substring(0, 3)); + } else if (value!.indexOf('%') == 2) { + percentage = int.parse(value!.substring(0, 2)); + } else if (value!.indexOf('%') == 1 && value!.indexOf('%') != 0 && value!.indexOf('%') != "") { + percentage = int.parse(value!.substring(0, 1)); + } else if (value!.indexOf('%') == 0 || value!.indexOf('%') == "") { + percentage = 0; + } showModalBottomSheet( context: context, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), @@ -499,6 +458,8 @@ class _MonthlyAttendanceState extends State { 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( @@ -524,11 +485,12 @@ class _MonthlyAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column(children: [ - "${getScheduleShiftsDetailsList!.sCHEDULEDATE!.substring(0, 9)}".toText24(isBold: true, color: Colors.white), - "Attendance Details".tr().toText16(color: MyColors.lightGreyEFColor), - 21.height, - ]).paddingOnly(top: 25, left: 21, right: 21, bottom: 10), + 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, @@ -542,9 +504,9 @@ class _MonthlyAttendanceState extends State { mainAxisSize: MainAxisSize.min, children: [ "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), - "Completed".tr().toText11(color: MyColors.greyACColor), + LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor), 19.height, - "Shift Time".tr().toText11(color: MyColors.greyACColor), + LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor), "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), ], ), @@ -574,11 +536,13 @@ class _MonthlyAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Actual Check In ".tr().toText11( + LocaleKeys.actualCheckIn.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true), + "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}" !="" + ? "${getScheduleShiftsDetailsList!.sHTACTUALSTARTTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), ], ), ), @@ -586,11 +550,13 @@ class _MonthlyAttendanceState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Actual Check Out".tr().toText11( + LocaleKeys.actualCheckOut.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true), + "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}" != "" + ? "${getScheduleShiftsDetailsList!.sHTACTUALENDTIME}".toText22(color: Colors.black, isBold: true) + : "__".toText22(color: Colors.black, isBold: true), ], ), ], @@ -609,11 +575,13 @@ class _MonthlyAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Approved Check In".tr().toText11( + LocaleKeys.approvedCheckIn.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true), + "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}" !="" + ? "${getScheduleShiftsDetailsList!.aPPROVEDSTARTTIME}".toText22(color: MyColors.greenColor, isBold: true) + :"__".toText22(color: MyColors.greenColor, isBold: true), ], ), ), @@ -621,11 +589,13 @@ class _MonthlyAttendanceState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Approved Check Out".tr().toText11( + LocaleKeys.approvedCheckOut.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true), + "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}"!= "" + ? "${getScheduleShiftsDetailsList!.aPPROVEDENDTIME}".toText22(color: MyColors.greenColor, isBold: true) + :"__".toText22(color: MyColors.greenColor, isBold: true), ], ), ], @@ -644,11 +614,11 @@ class _MonthlyAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Late In".tr().toText11( + LocaleKeys.lateIn.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getDayHoursTypeDetailsList[i].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), + "${getDayHoursTypeDetailsList[index].lATEINHRS}".toText22(color: MyColors.redColor, isBold: true), ], ), ), @@ -656,11 +626,11 @@ class _MonthlyAttendanceState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Excess".tr().toText11( + LocaleKeys.excess.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getDayHoursTypeDetailsList[i].eXCESSHRS}".toText22(color: Colors.black, isBold: true), + "${getDayHoursTypeDetailsList[index].eXCESSHRS}".toText22(color: Colors.black, isBold: true), ], ), ], @@ -679,11 +649,11 @@ class _MonthlyAttendanceState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Shortage".tr().toText11( + LocaleKeys.shortage.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getDayHoursTypeDetailsList[i].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true), + "${getDayHoursTypeDetailsList[index].sHORTAGEHRS}".toText22(color: Colors.black, isBold: true), ], ), ), @@ -691,11 +661,11 @@ class _MonthlyAttendanceState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Early Out".tr().toText11( + LocaleKeys.earlyOut.tr().toText11( color: MyColors.grey67Color, ), 8.height, - "${getDayHoursTypeDetailsList[i].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), + "${getDayHoursTypeDetailsList[index].eARLYOUTHRS}".toText22(color: Colors.black, isBold: true), ], ), ], @@ -752,6 +722,35 @@ class _MonthlyAttendanceState extends State { return "December"; } } + + static getMonthAr(int month){ + switch (month) { + case 1: + return 'يناير'; + case 2: + return ' فبراير'; + case 3: + return 'مارس'; + case 4: + return 'أبريل'; + case 5: + return 'مايو'; + case 6: + return 'يونيو'; + case 7: + return 'يوليو'; + case 8: + return 'أغسطس'; + case 9: + return 'سبتمبر'; + case 10: + return ' اكتوبر'; + case 11: + return ' نوفمبر'; + case 12: + return 'ديسمبر'; + } + } } class MeetingDataSource extends CalendarDataSource { diff --git a/lib/ui/my_attendance/my_attendance_screen.dart b/lib/ui/my_attendance/my_attendance_screen.dart index f171577..8be702f 100644 --- a/lib/ui/my_attendance/my_attendance_screen.dart +++ b/lib/ui/my_attendance/my_attendance_screen.dart @@ -25,6 +25,13 @@ class MyAttendanceScreen extends StatelessWidget { height: double.infinity, child: ListView( children: [ + itemView( + "assets/images/pdf.svg", + LocaleKeys.monthlyAttendance.tr(), + ).onPress(() { + Navigator.pushNamed(context, AppRoutes.monthlyAttendance); + }), + 12.height, itemView( "assets/images/pdf.svg", LocaleKeys.missingSwipes.tr(), diff --git a/lib/ui/profile/basic_details.dart b/lib/ui/profile/basic_details.dart index e229918..4bcd235 100644 --- a/lib/ui/profile/basic_details.dart +++ b/lib/ui/profile/basic_details.dart @@ -97,11 +97,7 @@ class _BasicDetailsState extends State { children: [ Container( width: double.infinity, - margin: EdgeInsets.only( - top: 28, - left: 26, - right: 26, - ), + margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20), padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5), height: 280, decoration: BoxDecoration( diff --git a/lib/ui/profile/contact_details.dart b/lib/ui/profile/contact_details.dart index 32f0ce8..4471f31 100644 --- a/lib/ui/profile/contact_details.dart +++ b/lib/ui/profile/contact_details.dart @@ -78,83 +78,86 @@ class _ContactDetailsState extends State { ), backgroundColor: MyColors.backgroundColor, bottomSheet:footer(), - body: Column( - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 28, left: 26, right: 26,), - padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), - height: 150, - 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), + body: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20), + padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), + height: 150, + 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( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${getEmployeePhonesList[0].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), + "${getEmployeePhonesList[0].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeePhonesList[1].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), + "${getEmployeePhonesList[1].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + ] + ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "${getEmployeePhonesList[0].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), - "${getEmployeePhonesList[0].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeePhonesList[1].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), - "${getEmployeePhonesList[1].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), - ] + Container( + width: double.infinity, + margin: EdgeInsets.only( left: 26, right: 26,bottom: 100), + padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), + height: 400, + 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( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeeAddressList[2].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[2].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeeAddressList[3].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[3].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeeAddressList[4].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[4].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeeAddressList[5].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[5].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + SizedBox( + height: 20,), + "${getEmployeeAddressList[6].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), + "${getEmployeeAddressList[6].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), + ] + ), ), - ), - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 28, left: 26, right: 26,), - padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), - height: 400, - 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( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeeAddressList[2].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[2].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeeAddressList[3].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[3].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeeAddressList[4].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[4].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeeAddressList[5].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[5].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - SizedBox( - height: 20,), - "${getEmployeeAddressList[6].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), - "${getEmployeeAddressList[6].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), - ] - ), - ), - ], + ], + ), ) ); diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index d62f101..6f50c51 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -59,146 +59,146 @@ class _FamilyMembersState extends State { ), backgroundColor: MyColors.backgroundColor, bottomSheet:footer(), - body: Column( - children: [ - SizedBox(height: 20,), - getEmployeeContactsList.length != 0 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: getEmployeeContactsList.length, - itemBuilder: (context, index) { - return Container( - child: Column( - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 26, right: 26,), - padding: EdgeInsets.only(left: 14, right: 14,top: 13, ), - height: 110, - 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( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor), - "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor), - SizedBox(height: 5,), - Divider( - color: MyColors.lightGreyEFColor, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, + body: Container( + width: MediaQuery.of(context).size.width, + child: getEmployeeContactsList.length != 0 + ? SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: getEmployeeContactsList.length, + itemBuilder: (context, index) { + return Container( + child: Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 20, left: 21, right: 21,), + padding: EdgeInsets.only(left: 14, right: 14,top: 13, ), + height: 110, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 26, + offset: Offset(0, 3), ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - child: InkWell( - onTap: () { - - }, - child: RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon( - Icons.edit, - size: 15, - color: MyColors.grey67Color, + ], + color: Colors.white, + borderRadius: BorderRadius.circular(10.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor), + "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor), + SizedBox(height: 5,), + Divider( + color: MyColors.lightGreyEFColor, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + child: InkWell( + onTap: () { + + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.edit, + size: 15, + color: MyColors.grey67Color, + ), ), - ), - TextSpan( - text: LocaleKeys.update.tr(), - style: TextStyle( - color: MyColors.grey67Color, - fontSize: 12, - fontWeight: FontWeight.bold, + TextSpan( + text: LocaleKeys.update.tr(), + style: TextStyle( + color: MyColors.grey67Color, + fontSize: 12, + fontWeight: FontWeight.bold, + ), ), - ), - ], + ], + ), ), + ) + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: SizedBox( + child: Container( + width: 3, + color: MyColors.lightGreyEFColor, ), - ) - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: SizedBox( - child: Container( - width: 3, - color: MyColors.lightGreyEFColor, ), ), - ), - Container( - child: InkWell( - onTap: () { - showAlertDialog(context); - }, - child: RichText( - text: TextSpan( - children: [ - WidgetSpan( - child: Icon( - Icons.delete, - size: 15, - color: Color(0x99FF0000), + Container( + child: InkWell( + onTap: () { + showAlertDialog(context); + }, + child: RichText( + text: TextSpan( + children: [ + WidgetSpan( + child: Icon( + Icons.delete, + size: 15, + color: Color(0x99FF0000), + ), ), - ), - TextSpan( - text:LocaleKeys.remove.tr(), - style: TextStyle( - color: MyColors.DarkRedColor, - fontSize: 12, - fontWeight: FontWeight.bold, + TextSpan( + text:LocaleKeys.remove.tr(), + style: TextStyle( + color: MyColors.DarkRedColor, + fontSize: 12, + fontWeight: FontWeight.bold, + ), ), - ), - ], + ], + ), ), - ), - ) - ), - // ElevatedButton.icon( - // icon: Icon( - // Icons.delete, - // size: 15, - // color: Color(0x99FF0000), - // ), - // style: ElevatedButton.styleFrom( - // shadowColor: Colors.white, - // primary: Colors.white, - // ), - // label: "remove".toText12(color: MyColors.DarkRedColor), - // onPressed: (){}, - // ), - ], - ), - ] + ) + ), + // ElevatedButton.icon( + // icon: Icon( + // Icons.delete, + // size: 15, + // color: Color(0x99FF0000), + // ), + // style: ElevatedButton.styleFrom( + // shadowColor: Colors.white, + // primary: Colors.white, + // ), + // label: "remove".toText12(color: MyColors.DarkRedColor), + // onPressed: (){}, + // ), + ], + ), + ] + ), ), - ), - ], - ) - ); - }) + ], + ) + ); + }) ], ), - ):Container(), - ], + ):Container(), + // SizedBox(height: 20), ) @@ -223,17 +223,17 @@ class _FamilyMembersState extends State { showAlertDialog(BuildContext context) { Widget cancelButton = TextButton( - child: Text("CANCEL"), + child: Text(LocaleKeys.cancel.tr(),), onPressed: () { Navigator.pop(context); }, ); Widget continueButton = TextButton( - child: Text("OK"), + child: Text(LocaleKeys.ok.tr(),), onPressed: () {}, ); AlertDialog alert = AlertDialog( - title: Text("Confirm"), + title: Text(LocaleKeys.confirm.tr(),), content: Text("Are You Sure You Want to Remove this Member?"), actions: [ cancelButton, diff --git a/lib/ui/profile/personal_info.dart b/lib/ui/profile/personal_info.dart index b136141..c4d2c6f 100644 --- a/lib/ui/profile/personal_info.dart +++ b/lib/ui/profile/personal_info.dart @@ -58,7 +58,7 @@ class _PesonalInfoState extends State { children: [ Container( width: double.infinity, - margin: EdgeInsets.only(top: 28, left: 26, right: 26,), + margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20), padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), height: 350, decoration: BoxDecoration( diff --git a/pubspec.yaml b/pubspec.yaml index 8afdae3..2447b3d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,6 +55,7 @@ dependencies: nfc_manager: ^3.1.1 uuid: ^3.0.6 + # maps google_maps_flutter: ^2.0.2 google_maps_utils: ^1.4.0+1 @@ -62,6 +63,8 @@ dependencies: geolocator: any # flutter_compass: ^0.6.1 google_maps_flutter_web: ^0.3.2 + month_year_picker: ^0.2.0+1 + month_picker_dialog: ^0.4.0 dev_dependencies: