fix monthly attendance

merge-requests/1/merge
Fatimah Alshammari 3 years ago
parent 1305e895a1
commit d2a6ed8de7

@ -24,7 +24,7 @@
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",
"services": "خدمات", "services": "خدمات",
@ -56,10 +56,10 @@
"order": "الطلبات", "order": "الطلبات",
"earlyOut": "الخروج مبكرا", "earlyOut": "الخروج مبكرا",
"shortage": "ساعات التقصير", "shortage": "ساعات التقصير",
"excess": "Excess", "excess": "فائض",
"lateIn": "القدوم المتاخر", "lateIn": "القدوم المتاخر",
"approvedCheckOut": "وقت الخروج", "approvedCheckOut": "اعتماد وقت الخروج",
"approvedCheckIn": "وقت الدخول", "approvedCheckIn": "اعتماد وقت الدخول",
"actualCheckOut": "وقت الخروج", "actualCheckOut": "وقت الخروج",
"actualCheckIn": "وقت الدخول", "actualCheckIn": "وقت الدخول",
"present": "حضور", "present": "حضور",
@ -229,7 +229,7 @@
"approvalLevel": "مستوى الموافقة", "approvalLevel": "مستوى الموافقة",
"requesterDetails": "تفاصيل مقدم الطلب", "requesterDetails": "تفاصيل مقدم الطلب",
"myAttendance": "حضوري", "myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة", "workOnBreak": "التعويض عن العمل اثناءالاستراحه",
"next": "التالي", "next": "التالي",
"completingYear": "نحن نقدر لك لاستكمال خدمة", "completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة", "year": "سنة",

@ -62,10 +62,10 @@
"approvedCheckIn": "Approved Check In", "approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out", "actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In", "actualCheckIn": "Actual Check In",
"present": "PRESENT 11", "present": "PRESENT",
"pres": "present", "pres": "present",
"shiftTime": "Shift Time", "shiftTime": "Shift Time",
"absent": "ABSENT 10", "absent": "ABSENT",
"attendance": "Attendance", "attendance": "Attendance",
"scheduleDays": "Schedule\nDays", "scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays", "offDays": "Off\nDays",
@ -244,8 +244,9 @@
"dateOfBirth" : "Date of Birth", "dateOfBirth" : "Date of Birth",
"maritalStatus ": "Marital Status ", "maritalStatus ": "Marital Status ",
"fullName": "Full Name", "fullName": "Full Name",
"remove": "remove", "remove": "Remove",
"update": "update", "update": "Update",
"Attendance":"Attendance",
"profile": { "profile": {
"reset_password": { "reset_password": {
"label": "Reset Password", "label": "Reset Password",

@ -26,9 +26,11 @@ class MonthlyAttendanceApiClient {
"SearchMonth": month, "SearchMonth": month,
"SearchYear": year, "SearchYear": year,
}; };
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print(responseData);
return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null; return (responseData.getTimeCardSummaryList?.length ?? 0) > 0 ? responseData.getTimeCardSummaryList!.first : null;
}, url, postParams); }, url, postParams);
} }
@ -48,7 +50,6 @@ class MonthlyAttendanceApiClient {
// postParams["DeviceType"] = deviceType; // postParams["DeviceType"] = deviceType;
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);
print("Response Data______");
print(responseData.getDayHoursTypeDetailsList!.length); print(responseData.getDayHoursTypeDetailsList!.length);
return responseData.getDayHoursTypeDetailsList ?? []; return responseData.getDayHoursTypeDetailsList ?? [];
}, url, postParams); }, url, postParams);

@ -40,7 +40,7 @@ class CodegenLoader extends AssetLoader{
"checkIn": "تحقق في", "checkIn": "تحقق في",
"workList": "قائمة العمل", "workList": "قائمة العمل",
"leaveBalance": "رصيد الاجازات", "leaveBalance": "رصيد الاجازات",
"missingSwipes": "الضربات الشديدة في عداد المفقودين", "missingSwipes": "تسجيل بصمة حضور",
"ticketBalance": "رصيد التذكرة", "ticketBalance": "رصيد التذكرة",
"other": "آخر", "other": "آخر",
"services": "خدمات", "services": "خدمات",
@ -72,10 +72,10 @@ class CodegenLoader extends AssetLoader{
"order": "الطلبات", "order": "الطلبات",
"earlyOut": "الخروج مبكرا", "earlyOut": "الخروج مبكرا",
"shortage": "ساعات التقصير", "shortage": "ساعات التقصير",
"excess": "Excess", "excess": "فائض",
"lateIn": "القدوم المتاخر", "lateIn": "القدوم المتاخر",
"approvedCheckOut": "وقت الخروج", "approvedCheckOut": "اعتماد وقت الخروج",
"approvedCheckIn": "وقت الدخول", "approvedCheckIn": "اعتماد وقت الدخول",
"actualCheckOut": "وقت الخروج", "actualCheckOut": "وقت الخروج",
"actualCheckIn": "وقت الدخول", "actualCheckIn": "وقت الدخول",
"present": "حضور", "present": "حضور",
@ -245,7 +245,7 @@ class CodegenLoader extends AssetLoader{
"approvalLevel": "مستوى الموافقة", "approvalLevel": "مستوى الموافقة",
"requesterDetails": "تفاصيل مقدم الطلب", "requesterDetails": "تفاصيل مقدم الطلب",
"myAttendance": "حضوري", "myAttendance": "حضوري",
"workOnBreak": "العمل على استراحة", "workOnBreak": "التعويض عن العمل اثناءالاستراحه",
"next": "التالي", "next": "التالي",
"completingYear": "نحن نقدر لك لاستكمال خدمة", "completingYear": "نحن نقدر لك لاستكمال خدمة",
"year": "سنة", "year": "سنة",
@ -340,7 +340,7 @@ static const Map<String,dynamic> en_US = {
"setTheNewPassword": "Set the new password", "setTheNewPassword": "Set the new password",
"typeYourNewPasswordBelow": "Type your new password below", "typeYourNewPasswordBelow": "Type your new password below",
"confirmPassword": "Confirm Password", "confirmPassword": "Confirm Password",
"update": "update", "update": "Update",
"title": "Title", "title": "Title",
"home": "Home", "home": "Home",
"mySalary": "My Salary", "mySalary": "My Salary",
@ -363,10 +363,10 @@ static const Map<String,dynamic> en_US = {
"approvedCheckIn": "Approved Check In", "approvedCheckIn": "Approved Check In",
"actualCheckOut": "Actual Check Out", "actualCheckOut": "Actual Check Out",
"actualCheckIn": "Actual Check In", "actualCheckIn": "Actual Check In",
"present": "PRESENT 11", "present": "PRESENT",
"pres": "present", "pres": "present",
"shiftTime": "Shift Time", "shiftTime": "Shift Time",
"absent": "ABSENT 10", "absent": "ABSENT",
"attendance": "Attendance", "attendance": "Attendance",
"scheduleDays": "Schedule\nDays", "scheduleDays": "Schedule\nDays",
"offDays": "Off\nDays", "offDays": "Off\nDays",
@ -544,7 +544,8 @@ static const Map<String,dynamic> en_US = {
"dateOfBirth": "Date of Birth", "dateOfBirth": "Date of Birth",
"maritalStatus ": "Marital Status ", "maritalStatus ": "Marital Status ",
"fullName": "Full Name", "fullName": "Full Name",
"remove": "remove", "remove": "Remove",
"Attendance": "Attendance",
"profile": { "profile": {
"reset_password": { "reset_password": {
"label": "Reset Password", "label": "Reset Password",

@ -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/provider/eit_provider_model.dart';
import 'package:mohem_flutter_app/theme/app_theme.dart'; import 'package:mohem_flutter_app/theme/app_theme.dart';
import 'package:mohem_flutter_app/widgets/nfc/nfc_reader_sheet.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/nfc_manager.dart';
import 'package:nfc_manager/platform_tags.dart'; import 'package:nfc_manager/platform_tags.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -30,7 +31,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
await Firebase.initializeApp(); await Firebase.initializeApp();
AppState().setPostParamsModel( 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( runApp(
EasyLocalization( EasyLocalization(
@ -68,12 +69,22 @@ class MyApp extends StatelessWidget {
builder: (context, orientation, deviceType) { builder: (context, orientation, deviceType) {
print(AppState().postParamsObject?.toJson()); print(AppState().postParamsObject?.toJson());
var obj = AppState().postParamsObject; 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!); AppState().setPostParamsModel(obj!);
List<LocalizationsDelegate> delegates = context.localizationDelegates;
// delegates.add(GlobalMaterialLocalizations.delegate);
delegates.add(MonthYearPickerLocalizations.delegate,);
return MaterialApp( return MaterialApp(
theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"), theme: AppTheme.getTheme(EasyLocalization
.of(context)
?.locale
.languageCode == "ar"),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
localizationsDelegates: context.localizationDelegates, localizationsDelegates
:delegates,
supportedLocales: context.supportedLocales, supportedLocales: context.supportedLocales,
locale: context.locale, locale: context.locale,
initialRoute: AppRoutes.initialRoute, initialRoute: AppRoutes.initialRoute,

@ -1,14 +1,14 @@
class GetDayHoursTypeDetailsList { class GetDayHoursTypeDetailsList {
Null? aBSENCEATTENDANCEID; dynamic? aBSENCEATTENDANCEID;
Null? aBSENCEATTENDANCETYPEID; dynamic? aBSENCEATTENDANCETYPEID;
String? aBSENTFLAG; String? aBSENTFLAG;
String? aCTUALHRS; String? aCTUALHRS;
String? aNALAYZEDFLAG; String? aNALAYZEDFLAG;
String? aPPROVEDTIMEBACKHRS; String? aPPROVEDTIMEBACKHRS;
String? aPPRTIMEBACKFLAG; String? aPPRTIMEBACKFLAG;
int? aSSIGNMENTID; dynamic? aSSIGNMENTID;
String? aTTENDEDFLAG; String? aTTENDEDFLAG;
Null? cALENDARENTRYID; dynamic? cALENDARENTRYID;
String? cOMPOFFFLAG; String? cOMPOFFFLAG;
String? cOMPOFFHRS; String? cOMPOFFHRS;
String? cOMPOFFHHRS; String? cOMPOFFHHRS;
@ -19,18 +19,18 @@ class GetDayHoursTypeDetailsList {
String? eARLYOUTHRS; String? eARLYOUTHRS;
String? eXCESSFLAG; String? eXCESSFLAG;
String? eXCESSHRS; String? eXCESSHRS;
int? fROMROWNUM; dynamic? fROMROWNUM;
String? lATEINFLAG; String? lATEINFLAG;
String? lATEINHRS; String? lATEINHRS;
String? mISSINGSWIPEFLAG; String? mISSINGSWIPEFLAG;
String? nONSCHEDULEDFLAG; String? nONSCHEDULEDFLAG;
Null? nOOFROWS; dynamic? nOOFROWS;
String? oNCALLHRS; String? oNCALLHRS;
Null? pERSONEXTRAINFOID; dynamic? pERSONEXTRAINFOID;
String? pLANNEDOTHRS; String? pLANNEDOTHRS;
String? pLANNEDOTHRSFLAG; String? pLANNEDOTHRSFLAG;
String? rEMARKS; String? rEMARKS;
int? rOWNUM; dynamic? rOWNUM;
int? rTPID; int? rTPID;
String? sCHEDULEDHRS; String? sCHEDULEDHRS;
String? sCHEDULEDONCALLHRS; String? sCHEDULEDONCALLHRS;
@ -40,7 +40,7 @@ class GetDayHoursTypeDetailsList {
String? sHORTAGEHRS; String? sHORTAGEHRS;
String? tIMEBACKFLAG; String? tIMEBACKFLAG;
String? tIMEBACKHRS; String? tIMEBACKHRS;
int? tOROWNUM; dynamic? tOROWNUM;
GetDayHoursTypeDetailsList( GetDayHoursTypeDetailsList(
{this.aBSENCEATTENDANCEID, {this.aBSENCEATTENDANCEID,

@ -2,39 +2,39 @@
class GetTimeCardSummaryList { class GetTimeCardSummaryList {
int? aBSENTDAYS; int? aBSENTDAYS;
int? aCTUALHRS; dynamic? aCTUALHRS;
int? aPPROVEDTIMEBACKHRS; dynamic? aPPROVEDTIMEBACKHRS;
int? aSSIGNMENTID; int? aSSIGNMENTID;
int? aTTENDEDDAYS; int? aTTENDEDDAYS;
int? bUSINESSTRIP; int? bUSINESSTRIP;
int? cOMPOFFHHRS; dynamic? cOMPOFFHHRS;
int? cOMPOFFNHRS; dynamic? cOMPOFFNHRS;
int? cOMPOFFWHRS; dynamic? cOMPOFFWHRS;
int? dESIREDSCHEDULEDHRS; dynamic? dESIREDSCHEDULEDHRS;
int? eARLYOUTHRS; dynamic? eARLYOUTHRS;
int? eXCESSHRS; dynamic? eXCESSHRS;
int? hALFDAYLEAVE; int? hALFDAYLEAVE;
int? lATEINHRS; dynamic? lATEINHRS;
int? lEAVESHOLIDAYSHRS; dynamic? lEAVESHOLIDAYSHRS;
int? nONSCHEDULEDAYS; dynamic? nONSCHEDULEDAYS;
int? nOTANALYZEDDAYS; dynamic? nOTANALYZEDDAYS;
int? oFFDAYS; int? oFFDAYS;
int? oNCALLHRS; dynamic? oNCALLHRS;
int? pAIDLEAVE; dynamic? pAIDLEAVE;
int? pERIODDAYS; int? pERIODDAYS;
int? pLANNEDOTHRS; dynamic? pLANNEDOTHRS;
int? pUBLICHOLIDAY; int? pUBLICHOLIDAY;
int? sCHEDULEDHRS; dynamic? sCHEDULEDHRS;
int? sCHEDULEDONCALLHRS; dynamic? sCHEDULEDONCALLHRS;
int? sCHEDULEDPLANNEDOTHRS; dynamic? sCHEDULEDPLANNEDOTHRS;
int? sCHEDULEDAYS; int? sCHEDULEDAYS;
int? sHORTAGEHRS; dynamic? sHORTAGEHRS;
int? sHORTAGESCHEDULEHRS; dynamic? sHORTAGESCHEDULEHRS;
int? sICKLEAVE; int? sICKLEAVE;
int? tIMEBACKHRS; dynamic? tIMEBACKHRS;
double? tIMEBACKBALANCE; dynamic? tIMEBACKBALANCE;
int? uNAUTHORIZEDLEAVE; int? uNAUTHORIZEDLEAVE;
int? uNCOVERDSHORTAGEHRS; dynamic? uNCOVERDSHORTAGEHRS;
int? uNPAIDLEAVE; int? uNPAIDLEAVE;
GetTimeCardSummaryList( GetTimeCardSummaryList(

@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization/src/public_ext.dart'; import 'package:easy_localization/src/public_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/painting.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/api/monthlyAttendance_api_client.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.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:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:pie_chart/pie_chart.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 { class MonthlyAttendance extends StatefulWidget {
MonthlyAttendance({Key? key}) : super(key: key); MonthlyAttendance({Key? key}) : super(key: key);
@ -28,12 +33,12 @@ class MonthlyAttendance extends StatefulWidget {
} }
class _MonthlyAttendanceState extends State<MonthlyAttendance> { class _MonthlyAttendanceState extends State<MonthlyAttendance> {
bool isPresent = true; bool isPresent = false;
bool isAbsent = true; bool isAbsent = false;
bool isMissingDays = true; bool isMissing = false;
bool isOffDays = true; bool isOff = false;
DateTime date = DateTime.now(); DateTime date = DateTime.now();
late var formattedDate; late DateTime formattedDate;
var currentMonth = DateTime.now().month; var currentMonth = DateTime.now().month;
String searchMonth = getMonth(DateTime.now().month); String searchMonth = getMonth(DateTime.now().month);
int searchYear = DateTime.now().year; int searchYear = DateTime.now().year;
@ -41,84 +46,42 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
List<GetDayHoursTypeDetailsList> getDayHoursTypeDetailsList = []; List<GetDayHoursTypeDetailsList> getDayHoursTypeDetailsList = [];
GetTimeCardSummaryList? getTimeCardSummaryList; GetTimeCardSummaryList? getTimeCardSummaryList;
// GetDayHoursTypeDetailsList? getDayHoursTypeDetailsList;
GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList; GetScheduleShiftsDetailsList? getScheduleShiftsDetailsList;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
getTimeCardSummary(searchMonth, searchYear); formattedDate = date;
getDayHoursTypeDetails(date.day, searchMonth, searchYear); callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
formattedDate = DateFormat('MMM-yyyy').format(date);
} }
void getTimeCardSummary(searchMonth, searchYear) async { void callTimeCardAndHourDetails(index, searchMonth, searchYear) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getTimeCardSummaryList = await MonthlyAttendanceApiClient().getTimeCardSummary(searchMonth, searchYear); 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); getDayHoursTypeDetailsList = await MonthlyAttendanceApiClient().getDayHoursTypeDetails(searchMonth, searchYear);
Utils.hideLoading(context); Utils.hideLoading(context);
pRTPID = getDayHoursTypeDetailsList[index].rTPID; _calendarController.displayDate = formattedDate;
setState(() {}); setState(() {});
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
countAllAttendDays();
getScheduleShiftsDetails(pRTPID);
} }
getScheduleShiftsDetails(pRTPID) async {
Future getScheduleShiftsDetails(index, pRTPID) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID); getScheduleShiftsDetailsList = await MonthlyAttendanceApiClient().getScheduleShiftsDetails(pRTPID);
Utils.hideLoading(context); Utils.hideLoading(context);
setState(() {}); //setState(() {});
} catch (ex) { } catch (ex) {
Utils.hideLoading(context); Utils.hideLoading(context);
Utils.handleException(ex, context, null); 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 CalendarController _calendarController = CalendarController();
final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)]; final List<Color> _colorList = [Color(0xff2AB2AB), Color(0xff202529)];
@ -126,8 +89,8 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Map<String, double> dataMap = { Map<String, double> dataMap = {
"Present": getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble(), "Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0,
"Absent": getTimeCardSummaryList!.aBSENTDAYS!.toDouble(), "Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0,
}; };
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
@ -150,61 +113,42 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Attendance".toText24(isBold: true, color: MyColors.darkIconColor), LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.darkIconColor),
Row( Row(
children: [ children: [
Text(formattedDate), "${DateFormat("MMMM-yyyy").format(formattedDate)}".toText16(color: MyColors.greyACColor),
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor), const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor),
], ],
).onPress(() async { ).onPress(() async {
await showDatePicker( showMonthPicker(
context: context, context: context, //locale: EasyLocalization.of(context)?.locale,
initialDate: DateTime.now(), initialDate: formattedDate,
firstDate: DateTime(2021), firstDate: DateTime(searchYear - 2),
lastDate: DateTime.now(), 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) { ).then((selectedDate) {
if (selectedDate != null) { if (selectedDate != null) {
var selectedMonth = DateFormat('MMMM').format(selectedDate); searchMonth = getMonth(selectedDate.month);
var selectedYear = DateFormat('yyyy').format(selectedDate); searchYear = selectedDate.year;
searchMonth = selectedMonth; formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate);
searchYear = int.parse(selectedYear); // _calendarController.selectedDate = formattedDate;
setState(() { callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear);
// date = selectedDate;
formattedDate = DateFormat('MMMM-yyyy').format(selectedDate);
getTimeCardSummary(searchMonth, searchYear);
getDayHoursTypeDetails(selectedDate.day, searchMonth, searchYear);
});
} }
}); });
}) })
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
18.height, 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
optionUI("Schedule\nDays", "${getTimeCardSummaryList!.sCHEDULEDAYS}"), optionUI(LocaleKeys.scheduleDays.tr(), "${getTimeCardSummaryList?.sCHEDULEDAYS}"),
6.width, 6.width,
optionUI("Off\nDays", "${getTimeCardSummaryList!.oFFDAYS}"), optionUI(LocaleKeys.offDays.tr(), "${getTimeCardSummaryList?.oFFDAYS}"),
6.width, 6.width,
optionUI("Non\nAnalyzed", "${getTimeCardSummaryList!.uNAUTHORIZEDLEAVE}"), optionUI(LocaleKeys.nonAnalyzed.tr(), "${getTimeCardSummaryList?.uNAUTHORIZEDLEAVE}"),
6.width, 6.width,
optionUI("Shortage\nHour", "${getTimeCardSummaryList!.sHORTAGEHRS}"), optionUI(LocaleKeys.shortageHour.tr(), "${getTimeCardSummaryList?.sHORTAGEHRS}"),
], ],
).paddingOnly(left: 21, right: 21), ).paddingOnly(left: 21, right: 21),
35.height, 35.height,
@ -229,10 +173,10 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
children: <Widget>[ children: <Widget>[
Column( Column(
children: [ children: [
"Attendance".toText12(isBold: true, color: MyColors.grey3AColor), LocaleKeys.attendance.tr().toText12(isBold: true, color: MyColors.grey3AColor),
"Stats".toText24(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( Row(
children: [ children: [
Container( Container(
@ -245,7 +189,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
Container( Container(
margin: const EdgeInsets.only(left: 5, right: 5), 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), ).paddingOnly(left: 21, right: 23),
@ -262,13 +206,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
Container( Container(
margin: const EdgeInsets.only(left: 5, right: 5), margin: const EdgeInsets.only(left: 5, right: 5),
child: "ABSENT ${getTimeCardSummaryList!.aBSENTDAYS}".toText16( child: "${LocaleKeys.absent.tr()} ${getTimeCardSummaryList!.aBSENTDAYS}".toText16(
isBold: true, isBold: true,
color: MyColors.backgroundBlackColor, color: MyColors.backgroundBlackColor,
), ),
) )
], ],
).paddingOnly(left: 21, top: 8), ).paddingOnly(left: 21, top: 8, right: 23),
], ],
), ),
Column( Column(
@ -342,70 +286,116 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
Widget calendarWidget() { Widget calendarWidget() {
return SfCalendar( return SfCalendar(
view: CalendarView.month, view: CalendarView.month,
// onViewChanged: viewChanged, showDatePickerButton: false,
controller: _calendarController, controller: _calendarController,
headerHeight: 0, headerHeight: 0,
todayHighlightColor: MyColors.grey3AColor, 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( viewHeaderStyle: const ViewHeaderStyle(
dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600), dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600),
), ),
monthCellBuilder: (cxt, build) { monthCellBuilder: (build, details) {
int val = build.date.day; if (details.date.month == formattedDate.month && details.date.year == formattedDate.year) {
val == countAllAttendDays(); int val = details.date.day;
if (isPresent) { //check day is off
return Container( if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'N' && getDayHoursTypeDetailsList[val - 1].dAYTYPE == 'OFF') {
margin: const EdgeInsets.all(4), return Container(
decoration: BoxDecoration( margin: const EdgeInsets.all(4),
gradient: const LinearGradient( decoration: BoxDecoration(
transform: GradientRotation(.46), color: MyColors.greyACColor.withOpacity(.12),
begin: Alignment.topRight, shape: BoxShape.circle,
end: Alignment.bottomLeft,
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
), ),
shape: BoxShape.circle, alignment: Alignment.center,
boxShadow: [ child: Text(
BoxShadow( "${val}",
offset: const Offset(0, 2), style: const TextStyle(
blurRadius: 26, fontSize: 13,
color: MyColors.blackColor.withOpacity(0.100), 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) { //check day is Present
return Container( else if (getDayHoursTypeDetailsList[val - 1].aTTENDEDFLAG == 'Y') {
margin: const EdgeInsets.all(4), return Container(
decoration: BoxDecoration( margin: const EdgeInsets.all(4),
color: MyColors.backgroundBlackColor, decoration: BoxDecoration(
shape: BoxShape.circle, gradient: const LinearGradient(
boxShadow: [ transform: GradientRotation(.46),
BoxShadow( begin: Alignment.topRight,
offset: const Offset(0, 2), end: Alignment.bottomLeft,
blurRadius: 26, colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
color: MyColors.blackColor.withOpacity(0.100),
), ),
], shape: BoxShape.circle,
), boxShadow: [
alignment: Alignment.center, BoxShadow(
child: Text( offset: const Offset(0, 2),
"${build.date.day}", blurRadius: 26,
style: const TextStyle( color: MyColors.blackColor.withOpacity(0.100),
fontSize: 13, ),
fontWeight: FontWeight.w500, ],
color: MyColors.white,
), ),
), alignment: Alignment.center,
); child: Text(
} else if (isMissingDays) { "${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( return Container(
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -421,7 +411,7 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
"${build.date.day}", "${val}",
style: const TextStyle( style: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -429,66 +419,35 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
), ),
), ),
); );
} else if (isOffDays) { // return Container(
return Container( // alignment: Alignment.center,
margin: const EdgeInsets.all(4), // child: Text("$val"),
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,
),
),
);
} else { } 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) { calendarTapped(CalendarTapDetails details) async {
dynamic string = getScheduleShiftsDetailsList!.pERCENTAGE; dynamic index = details.date?.day;
dynamic percentage = string!.indexOf('%');
print(percentage);
print(details.date?.day.toString());
int? index = details.date?.day;
if (index != null) { if (index != null) {
index = index - 1; 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( showModalBottomSheet(
context: context, context: context,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
@ -499,6 +458,8 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
maxChildSize: 0.9, maxChildSize: 0.9,
expand: false, expand: false,
builder: (_, controller) { builder: (_, controller) {
dynamic dmyString = getScheduleShiftsDetailsList!.sCHEDULEDATE;
DateTime dateTime1 = DateFormat("MM/dd/yyyy hh:mm:ss a").parse(dmyString);
return Column( return Column(
children: [ children: [
Container( Container(
@ -524,11 +485,12 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column(children: [ Container(child:
"${getScheduleShiftsDetailsList!.sCHEDULEDATE!.substring(0, 9)}".toText24(isBold: true, color: Colors.white), "${DateFormat("MMMM-dd-yyyy").format(dateTime1).replaceAll('-', " ")}".toText24(isBold: true, color: Colors.white),
"Attendance Details".tr().toText16(color: MyColors.lightGreyEFColor), ).paddingOnly(top: 26, left: 21, right: 21),
21.height, Container(
]).paddingOnly(top: 25, left: 21, right: 21, bottom: 10), child: LocaleKeys.attendanceDetails.tr().toText16(color: MyColors.greyACColor).paddingOnly(left: 21,bottom: 16),
),
Center( Center(
child: CircularStepProgressBar( child: CircularStepProgressBar(
totalSteps: 16 * 4, totalSteps: 16 * 4,
@ -542,9 +504,9 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
"${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true), "${getScheduleShiftsDetailsList!.pERCENTAGE}".toText44(color: Colors.white, isBold: true),
"Completed".tr().toText11(color: MyColors.greyACColor), LocaleKeys.completed.tr().toText11(color: MyColors.greyACColor),
19.height, 19.height,
"Shift Time".tr().toText11(color: MyColors.greyACColor), LocaleKeys.shiftTime.tr().toText11(color: MyColors.greyACColor),
"${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true), "${getScheduleShiftsDetailsList!.sHTNAME}".toText22(color: Colors.white, isBold: true),
], ],
), ),
@ -574,11 +536,13 @@ class _MonthlyAttendanceState extends State<MonthlyAttendance> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Actual Check In ".tr().toText11( LocaleKeys.actualCheckIn.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Actual Check Out".tr().toText11( LocaleKeys.actualCheckOut.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Approved Check In".tr().toText11( LocaleKeys.approvedCheckIn.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Approved Check Out".tr().toText11( LocaleKeys.approvedCheckOut.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Late In".tr().toText11( LocaleKeys.lateIn.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Excess".tr().toText11( LocaleKeys.excess.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Shortage".tr().toText11( LocaleKeys.shortage.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Early Out".tr().toText11( LocaleKeys.earlyOut.tr().toText11(
color: MyColors.grey67Color, color: MyColors.grey67Color,
), ),
8.height, 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<MonthlyAttendance> {
return "December"; 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 { class MeetingDataSource extends CalendarDataSource {

@ -25,6 +25,13 @@ class MyAttendanceScreen extends StatelessWidget {
height: double.infinity, height: double.infinity,
child: ListView( child: ListView(
children: [ children: [
itemView(
"assets/images/pdf.svg",
LocaleKeys.monthlyAttendance.tr(),
).onPress(() {
Navigator.pushNamed(context, AppRoutes.monthlyAttendance);
}),
12.height,
itemView( itemView(
"assets/images/pdf.svg", "assets/images/pdf.svg",
LocaleKeys.missingSwipes.tr(), LocaleKeys.missingSwipes.tr(),

@ -97,11 +97,7 @@ class _BasicDetailsState extends State<BasicDetails> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20),
top: 28,
left: 26,
right: 26,
),
padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5), padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 5),
height: 280, height: 280,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -78,83 +78,86 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
bottomSheet:footer(), bottomSheet:footer(),
body: Column( body: SingleChildScrollView(
children: [ scrollDirection: Axis.vertical,
Container( child: Column(
width: double.infinity, children: [
margin: EdgeInsets.only(top: 28, left: 26, right: 26,), Container(
padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20), width: double.infinity,
height: 150, margin: EdgeInsets.only(top: 20, left: 21, right: 21,bottom: 20),
decoration: BoxDecoration( padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20),
boxShadow: [ height: 150,
BoxShadow( decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.5), boxShadow: [
spreadRadius: 5, BoxShadow(
blurRadius: 26, color: Colors.grey.withOpacity(0.5),
offset: Offset(0, 3), spreadRadius: 5,
), blurRadius: 26,
], offset: Offset(0, 3),
color: Colors.white, ),
borderRadius: BorderRadius.circular(10.0), ],
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( Container(
crossAxisAlignment: CrossAxisAlignment.start, width: double.infinity,
children: [ margin: EdgeInsets.only( left: 26, right: 26,bottom: 100),
"${getEmployeePhonesList[0].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20),
"${getEmployeePhonesList[0].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), height: 400,
SizedBox( decoration: BoxDecoration(
height: 20,), boxShadow: [
"${getEmployeePhonesList[1].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor), BoxShadow(
"${getEmployeePhonesList[1].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), 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),
]
),
),
],
) )
); );

@ -59,146 +59,146 @@ class _FamilyMembersState extends State<FamilyMembers> {
), ),
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
bottomSheet:footer(), bottomSheet:footer(),
body: Column( body: Container(
children: [ width: MediaQuery.of(context).size.width,
SizedBox(height: 20,), child: getEmployeeContactsList.length != 0
getEmployeeContactsList.length != 0 ? SingleChildScrollView(
? SingleChildScrollView( scrollDirection: Axis.vertical,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: getEmployeeContactsList.length, itemCount: getEmployeeContactsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
child: Column( child: Column(
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 26, right: 26,), margin: EdgeInsets.only(top: 20, left: 21, right: 21,),
padding: EdgeInsets.only(left: 14, right: 14,top: 13, ), padding: EdgeInsets.only(left: 14, right: 14,top: 13, ),
height: 110, height: 110,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 26, blurRadius: 26,
offset: Offset(0, 3), 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,
), ),
Row( ],
mainAxisAlignment: MainAxisAlignment.spaceEvenly, color: Colors.white,
children: <Widget>[ borderRadius: BorderRadius.circular(10.0),
Container( ),
child: InkWell( child: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
children: [
}, "${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor),
child: RichText( "${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
text: TextSpan( SizedBox(height: 5,),
children: [ Divider(
WidgetSpan( color: MyColors.lightGreyEFColor,
child: Icon( height: 20,
Icons.edit, thickness: 1,
size: 15, indent: 0,
color: MyColors.grey67Color, endIndent: 0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
child: InkWell(
onTap: () {
},
child: RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(
Icons.edit,
size: 15,
color: MyColors.grey67Color,
),
), ),
), TextSpan(
TextSpan( text: LocaleKeys.update.tr(),
text: LocaleKeys.update.tr(), style: TextStyle(
style: TextStyle( color: MyColors.grey67Color,
color: MyColors.grey67Color, fontSize: 12,
fontSize: 12, fontWeight: FontWeight.bold,
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(
Container( child: InkWell(
child: InkWell( onTap: () {
onTap: () { showAlertDialog(context);
showAlertDialog(context); },
}, child: RichText(
child: RichText( text: TextSpan(
text: TextSpan( children: [
children: [ WidgetSpan(
WidgetSpan( child: Icon(
child: Icon( Icons.delete,
Icons.delete, size: 15,
size: 15, color: Color(0x99FF0000),
color: Color(0x99FF0000), ),
), ),
), TextSpan(
TextSpan( text:LocaleKeys.remove.tr(),
text:LocaleKeys.remove.tr(), style: TextStyle(
style: TextStyle( color: MyColors.DarkRedColor,
color: MyColors.DarkRedColor, fontSize: 12,
fontSize: 12, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
), ),
), ],
], ),
), ),
), )
) ),
), // ElevatedButton.icon(
// ElevatedButton.icon( // icon: Icon(
// icon: Icon( // Icons.delete,
// Icons.delete, // size: 15,
// size: 15, // color: Color(0x99FF0000),
// color: Color(0x99FF0000), // ),
// ), // style: ElevatedButton.styleFrom(
// style: ElevatedButton.styleFrom( // shadowColor: Colors.white,
// shadowColor: Colors.white, // primary: Colors.white,
// primary: Colors.white, // ),
// ), // label: "remove".toText12(color: MyColors.DarkRedColor),
// label: "remove".toText12(color: MyColors.DarkRedColor), // onPressed: (){},
// onPressed: (){}, // ),
// ), ],
], ),
), ]
] ),
), ),
), ],
], )
) );
); })
})
], ],
), ),
):Container(), ):Container(),
], // SizedBox(height: 20),
) )
@ -223,17 +223,17 @@ class _FamilyMembersState extends State<FamilyMembers> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("CANCEL"), child: Text(LocaleKeys.cancel.tr(),),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
); );
Widget continueButton = TextButton( Widget continueButton = TextButton(
child: Text("OK"), child: Text(LocaleKeys.ok.tr(),),
onPressed: () {}, onPressed: () {},
); );
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
title: Text("Confirm"), title: Text(LocaleKeys.confirm.tr(),),
content: Text("Are You Sure You Want to Remove this Member?"), content: Text("Are You Sure You Want to Remove this Member?"),
actions: [ actions: [
cancelButton, cancelButton,

@ -58,7 +58,7 @@ class _PesonalInfoState extends State<PesonalInfo> {
children: [ children: [
Container( Container(
width: double.infinity, 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), padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20),
height: 350, height: 350,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -55,6 +55,7 @@ dependencies:
nfc_manager: ^3.1.1 nfc_manager: ^3.1.1
uuid: ^3.0.6 uuid: ^3.0.6
# maps # maps
google_maps_flutter: ^2.0.2 google_maps_flutter: ^2.0.2
google_maps_utils: ^1.4.0+1 google_maps_utils: ^1.4.0+1
@ -62,6 +63,8 @@ dependencies:
geolocator: any geolocator: any
# flutter_compass: ^0.6.1 # flutter_compass: ^0.6.1
google_maps_flutter_web: ^0.3.2 google_maps_flutter_web: ^0.3.2
month_year_picker: ^0.2.0+1
month_picker_dialog: ^0.4.0
dev_dependencies: dev_dependencies:

Loading…
Cancel
Save