diff --git a/assets/images/user.svg b/assets/images/user.svg new file mode 100644 index 0000000..13d9aed --- /dev/null +++ b/assets/images/user.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 7e2048d..1ba7218 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -356,6 +356,8 @@ "hours": "ساعات", "approvalStatus": "حالة القبول", "absenceStatus": "حالة الغياب", + "subordinateLeave": "إجازة التابعيين", + "numberDays": "عدد الأيام", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 38765dd..47d33b9 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -356,6 +356,8 @@ "hours": "Hours", "approvalStatus": "Approval Status", "absenceStatus": "Absence Status", + "subordinateLeave": "Subordinate Leave", + "numberDays": "Number of days", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 53499b8..7452524 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -371,6 +371,8 @@ class CodegenLoader extends AssetLoader{ "hours": "ساعات", "approvalStatus": "حالة القبول", "absenceStatus": "حالة الغياب", + "subordinateLeave": "إجازة التابعيين", + "numberDays": "عدد الأيام", "profile": { "reset_password": { "label": "Reset Password", @@ -762,6 +764,8 @@ static const Map en_US = { "hours": "Hours", "approvalStatus": "Approval Status", "absenceStatus": "Absence Status", + "subordinateLeave": "Subordinate Leave", + "numberDays": "Number of days", "profile": { "reset_password": { "label": "Reset Password", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 43165af..12fb29a 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -356,6 +356,8 @@ abstract class LocaleKeys { static const hours = 'hours'; static const approvalStatus = 'approvalStatus'; static const absenceStatus = 'absenceStatus'; + static const subordinateLeave = 'subordinateLeave'; + static const numberDays = 'numberDays'; static const profile_reset_password_label = 'profile.reset_password.label'; static const profile_reset_password_username = 'profile.reset_password.username'; static const profile_reset_password_password = 'profile.reset_password.password'; diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index b1252aa..26c844f 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -129,7 +129,6 @@ class _EmployeeDetailsState extends State { child: Stack(children: [ Container( width: _width, - //height: 150, margin: EdgeInsets.only(top: 50), //padding: EdgeInsets.only(right: 17, left: 17), decoration: BoxDecoration( @@ -168,7 +167,6 @@ class _EmployeeDetailsState extends State { color: MyColors.green9CColor, ), ), - // Container(height: 100, alignment: Alignment.center, child: ProfileImage()), InkWell( onTap:() { launchUrl(phoneNumber); @@ -185,7 +183,7 @@ class _EmployeeDetailsState extends State { customLabel(getEmployeeSubordinates!.eMPLOYEENUMBER.toString() + ' | ' + getEmployeeSubordinates!.jOBNAME.toString(), 13, MyColors.grey80Color, true), customLabel(getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS.toString(), 13, MyColors.grey3AColor, true), ], - ).paddingOnly(bottom: 10), + ).paddingOnly(bottom: 10, left: 35,right: 31), ], ), ), diff --git a/lib/ui/my_team/my_team.dart b/lib/ui/my_team/my_team.dart index 37ab561..15ce3d2 100644 --- a/lib/ui/my_team/my_team.dart +++ b/lib/ui/my_team/my_team.dart @@ -123,7 +123,6 @@ class _MyTeamState extends State { : ListView.separated( scrollDirection: Axis.vertical, shrinkWrap: true, - // padding: EdgeInsets.only(left: 21, right: 21), physics: ScrollPhysics(), separatorBuilder: (cxt, index) => 12.height, itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length, diff --git a/lib/ui/my_team/profile_details.dart b/lib/ui/my_team/profile_details.dart index 419f897..cfc1730 100644 --- a/lib/ui/my_team/profile_details.dart +++ b/lib/ui/my_team/profile_details.dart @@ -1,15 +1,12 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/app_state/app_state.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; -import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart'; -import 'package:mohem_flutter_app/models/member_information_list_model.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -import 'package:mohem_flutter_app/widgets/button/default_button.dart'; + class ProfileDetails extends StatefulWidget { const ProfileDetails({Key? key}) : super(key: key); @@ -19,7 +16,6 @@ class ProfileDetails extends StatefulWidget { } class _ProfileDetailsState extends State { - GetEmployeeSubordinatesList? getEmployeeSubordinates; diff --git a/lib/ui/my_team/subordinate_leave.dart b/lib/ui/my_team/subordinate_leave.dart index c5adb17..9e69fdc 100644 --- a/lib/ui/my_team/subordinate_leave.dart +++ b/lib/ui/my_team/subordinate_leave.dart @@ -32,8 +32,7 @@ class _SubordinateLeaveState extends State { DateTime selectedDateFrom = DateTime.now(); DateTime selectedDateTo = DateTime.now(); bool showList = false; - // DateTime dateFrom = DateFormat("MMM/DD/YYYY").format(selectedDateFrom) as DateTime; - // DateTime dateTo = DateFormat("MMM/DD/YYYY").format(selectedDateTo) as DateTime; + @@ -45,9 +44,11 @@ class _SubordinateLeaveState extends State { void getSubordinatesLeaves()async { try { Utils.showLoading(context); - getSubordinatesLeavesTotalList = await MyTeamApiClient().getSubordinatesLeavesList(selectedDateFrom.toIso8601String(), selectedDateTo.toIso8601String()); + getSubordinatesLeavesTotalList = await MyTeamApiClient().getSubordinatesLeavesList(DateUtil.convertDateToStringLocation(selectedDateFrom), DateUtil.convertDateToStringLocation(selectedDateTo)); + showList= true; Utils.hideLoading(context); - } catch (ex) {da + setState(() {}); + } catch (ex) { Utils.hideLoading(context); Utils.handleException(ex, context, null); } @@ -59,83 +60,94 @@ class _SubordinateLeaveState extends State { return Scaffold( appBar: AppBarWidget( context, - title: "Subordinate Leave", + title: LocaleKeys.subordinateLeave.tr(), ), backgroundColor: MyColors.backgroundColor, body: Column( children: [ Expanded( - child: Column( - children: [ - Column( + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( children: [ - DynamicTextFieldWidget( - LocaleKeys.dateFrom.tr(), - selectedDateFrom.toString().split(" ")[0], - suffixIconData: Icons.calendar_today, - isEnable: false, - onTap: () async { - selectedDateFrom = await _selectDate(context, DateTime.now()); - setState(() {}); - }, - ), - 12.height, - DynamicTextFieldWidget( - LocaleKeys.dateTo.tr(), - selectedDateTo.toString().split(" ")[0], - suffixIconData: Icons.calendar_today, - isEnable: false, - onTap: () async { - selectedDateTo = await _selectDate(context, DateTime.now()); - setState(() {}); - }, - ) - ], - ).objectContainerView(), - !showList? - SingleChildScrollView( - child: ListView.separated( + Column( + children: [ + DynamicTextFieldWidget( + LocaleKeys.dateFrom.tr(), + selectedDateFrom.toString().split(" ")[0], + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + selectedDateFrom = await _selectDate(context, DateTime.now()); + setState(() {}); + }, + ), + 12.height, + DynamicTextFieldWidget( + LocaleKeys.dateTo.tr(), + selectedDateTo.toString().split(" ")[0], + suffixIconData: Icons.calendar_today, + isEnable: false, + onTap: () async { + selectedDateTo = await _selectDate(context, DateTime.now()); + setState(() {}); + }, + ) + ], + ).objectContainerView(), + Container( + margin: EdgeInsets.only(left: 21, right: 21), + width: MediaQuery.of(context).size.width, + child: SingleChildScrollView( scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - separatorBuilder: (cxt, index) => 12.height, - itemCount: getSubordinatesLeavesTotalList.length, - itemBuilder: (context, index) { - var diffDays = selectedDateTo.difference(selectedDateFrom).inDays; - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // CircleAvatar( - // radius: 25, - // backgroundImage: MemoryImage(Utils.getPostBytes(getSubordinatesLeavesTotalList[index].eMPLOYEEIMAGE)), - // backgroundColor: Colors.black, - // ), - SvgPicture.asset("assets/images/clock.svg"), - 10.width, - "${getSubordinatesLeavesTotalList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - "From: ${getSubordinatesLeavesTotalList[index].dATESTART}".toText10(isBold: true, color: MyColors.grey57Color), - "To: ${getSubordinatesLeavesTotalList[index].dATEEND}".toText10(isBold: true, color: MyColors.grey57Color), - ], - ).expanded, - "Number of days: $diffDays".toText13(color: MyColors.grey3AColor), - ], - ).objectContainerView(); - }), - ).objectContainerView() - :Container(), - ], + child: Column( + children: [ + showList? ListView.separated( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + separatorBuilder: (BuildContext cxt,int index) => 12.height, + itemCount: getSubordinatesLeavesTotalList.length, + itemBuilder: (BuildContext context,int index) { + var diffDays = DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!).difference(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!)).inDays; + return getSubordinatesLeavesTotalList.isEmpty + ? Utils.getNoDataWidget(context) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset("assets/images/user.svg"), + 14.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "${getSubordinatesLeavesTotalList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor), + 10.height, + Row( + children: [ + (LocaleKeys.from.tr() + ': ${DateUtil.getFormattedDate(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!), "MMM dd yyyy")}').toText10(isBold: true, color: MyColors.grey57Color), + 14.width, + (LocaleKeys.to.tr() + ': ${DateUtil.getFormattedDate(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!), "MMM dd yyyy")}').toText10(isBold: true, color: MyColors.grey57Color), + ], + ), + (LocaleKeys.numberDays.tr()+ ": $diffDays").toText10(color: MyColors.grey3AColor), + ], + ).expanded + ], + ).objectContainerView(); + } + ) + :Container(), + ], + ), + ), + ), + ], + ), ), ), DefaultButton( LocaleKeys.submit.tr(), () async { getSubordinatesLeaves(); - setState(() { - showList= true; - }); - showList= true; }).insideContainer ], ), diff --git a/lib/ui/my_team/team_members.dart b/lib/ui/my_team/team_members.dart index f36a13b..37a779d 100644 --- a/lib/ui/my_team/team_members.dart +++ b/lib/ui/my_team/team_members.dart @@ -58,15 +58,16 @@ class _TeamMembersState extends State { scrollDirection: Axis.vertical, child: Column( children: [ - getEmployeeSubordinatesList != 0 - ? ListView.separated( + getEmployeeSubordinatesList.isEmpty + ? Utils.getNoDataWidget(context): + ListView.separated( scrollDirection: Axis.vertical, shrinkWrap: true, padding: EdgeInsets.all(21), physics: ScrollPhysics(), separatorBuilder: (cxt, index) => 12.height, itemCount: getEmployeeSubordinatesList.length, - itemBuilder: (context, index) { + itemBuilder: (BuildContext context, int index) { var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}'); return Container( child: Row( @@ -89,18 +90,20 @@ class _TeamMembersState extends State { Column( children: [ IconButton( - onPressed: () { - launchUrl(phoneNumber); + onPressed: () { + launchUrl(phoneNumber); }, icon: Icon( Icons.whatsapp, color: Colors.green, - ),),], - ),], - ),).objectContainerView(); - }): Container( - child: LocaleKeys.noResultsFound.tr().toText16(color: MyColors.blackColor), - ).paddingOnly(top: 10), + ), + ), + ], + ), + ], + ), + ).objectContainerView(); + }), ], ) )); diff --git a/lib/ui/my_team/view_attendance.dart b/lib/ui/my_team/view_attendance.dart index 06b0bce..28ab0f6 100644 --- a/lib/ui/my_team/view_attendance.dart +++ b/lib/ui/my_team/view_attendance.dart @@ -1,21 +1,17 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; -import 'package:mohem_flutter_app/api/monthly_attendance_api_client.dart'; import 'package:mohem_flutter_app/api/my_team/my_team_api_client.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/utils.dart'; -import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart'; import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart'; -import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart'; import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart'; import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; -import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart'; import 'package:month_picker_dialog/month_picker_dialog.dart'; import 'package:pie_chart/pie_chart.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; @@ -54,7 +50,6 @@ class _ViewAttendanceState extends State { super.initState(); formattedDate = date; callTimeCardAndHourDetails(date.day, searchMonth, searchYear); - // setState(() {}); } @@ -86,8 +81,7 @@ class _ViewAttendanceState extends State { "Present": getTimeCardSummaryList?.aTTENDEDDAYS != null ? getTimeCardSummaryList!.aTTENDEDDAYS!.toDouble() : 0, "Absent": getTimeCardSummaryList?.aBSENTDAYS != null ? getTimeCardSummaryList!.aBSENTDAYS!.toDouble() : 0, }; - //if(getTimeCardSummaryList ==null) - // callTimeCardAndHourDetails(date.day, searchMonth, searchYear); + return Scaffold( appBar: AppBarWidget( context, @@ -193,7 +187,6 @@ class _ViewAttendanceState extends State { searchMonth = getMonth(selectedDate.month); searchYear = selectedDate.year; formattedDate = selectedDate; //DateFormat('MMMM-yyyy').format(selectedDate); - // _calendarController.selectedDate = formattedDate; callTimeCardAndHourDetails(selectedDate.day, searchMonth, searchYear); } }); @@ -322,7 +315,6 @@ class _ViewAttendanceState extends State { dayFormat: 'EEE', showTrailingAndLeadingDates: false, showAgenda: false, - //navigationDirection: MonthNavigationDirection.vertical, monthCellStyle: MonthCellStyle( textStyle: TextStyle( fontStyle: FontStyle.normal, diff --git a/lib/ui/profile/family_members.dart b/lib/ui/profile/family_members.dart index c2b1e2f..f81a288 100644 --- a/lib/ui/profile/family_members.dart +++ b/lib/ui/profile/family_members.dart @@ -11,7 +11,6 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart'; import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart'; import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart'; -import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart'; import 'package:mohem_flutter_app/ui/profile/profile_screen.dart'; import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; import 'package:mohem_flutter_app/widgets/button/default_button.dart'; @@ -76,7 +75,6 @@ class _FamilyMembersState extends State { width: double.infinity, margin: EdgeInsets.only(left: 21, right: 21, ), - // padding: EdgeInsets.only(left: 14, right: 14, top: 13, bottom: 10), decoration: BoxDecoration( boxShadow: [ BoxShadow(