diff --git a/assets/images/call-disable.svg b/assets/images/call-disable.svg new file mode 100644 index 0000000..9924063 --- /dev/null +++ b/assets/images/call-disable.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 30c7e2e..f59dcf7 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -17,7 +17,7 @@ extension EmailValidator on String { Widget toText10({Color? color, bool isBold = false, int? maxLine}) => Text( this, - maxLines: maxlines, + //maxLines: maxlines, style: TextStyle(fontSize: 10, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), ); @@ -83,6 +83,12 @@ extension EmailValidator on String { style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), ); + Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text( + this, + maxLines: maxlines, + style: TextStyle(color: color ?? MyColors.grey3AColor, fontSize: 21, letterSpacing: -0.31, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)), + ); + Widget toText22({Color? color, bool isBold = false}) => Text( this, style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), diff --git a/lib/ui/my_team/employee_details.dart b/lib/ui/my_team/employee_details.dart index 26c844f..c9d723c 100644 --- a/lib/ui/my_team/employee_details.dart +++ b/lib/ui/my_team/employee_details.dart @@ -91,11 +91,11 @@ class _EmployeeDetailsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - 80.height, + 60.height, Container( - padding: EdgeInsets.only(left: 15, right: 15), + padding: EdgeInsets.only(left: 15, right: 15, bottom: 8), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( onPressed: () { @@ -124,103 +124,80 @@ class _EmployeeDetailsState extends State { .width; return Column( children: [ - Container( - margin: EdgeInsets.fromLTRB(21, 0, 21, 10), - child: Stack(children: [ - Container( - width: _width, - margin: EdgeInsets.only(top: 50), - //padding: EdgeInsets.only(right: 17, left: 17), - decoration: BoxDecoration( - color: MyColors.whiteColor, - borderRadius: const BorderRadius.all(Radius.circular(15)), - boxShadow: [BoxShadow(color: MyColors.lightGreyColor, blurRadius: 15, spreadRadius: 3)], - ), - child: Column( + Stack(children: [ + Container( + margin: EdgeInsets.fromLTRB(21, 40, 21, 0), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton( - onPressed: (){ - if(getEmployeeSubordinates!.isFavorite != true){ - showFavoriteAlertDialog(context); - setState(() {}); - }else{ - fetchChangeFav( - email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "", - employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "", - image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "", - userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "", - isFav: false,); - setState(() {}); - } }, - icon: getEmployeeSubordinates!.isFavorite != true - ? Icon( - Icons.star_outline, - size: 35, - color: MyColors.green9CColor, - ) - : Icon( - Icons.star_outlined, - size: 35, - color: MyColors.green9CColor, - ), - ), - InkWell( - onTap:() { - launchUrl(phoneNumber); - }, - child: SvgPicture.asset("assets/images/call.svg"), - ), - ], - ).paddingOnly(left:6, right: 17, top: 16), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - /// card header - customLabel(getEmployeeSubordinates!.eMPLOYEENAME.toString(), 21, MyColors.grey3AColor, true), - customLabel(getEmployeeSubordinates!.eMPLOYEENUMBER.toString() + ' | ' + getEmployeeSubordinates!.jOBNAME.toString(), 13, MyColors.grey80Color, true), - customLabel(getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS.toString(), 13, MyColors.grey3AColor, true), - ], - ).paddingOnly(bottom: 10, left: 35,right: 31), + IconButton( + onPressed: (){ + if(getEmployeeSubordinates!.isFavorite != true){ + showFavoriteAlertDialog(context); + setState(() {}); + }else{ + fetchChangeFav( + email: getEmployeeSubordinates?.eMPLOYEEEMAILADDRESS ?? "", + employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "", + image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "", + userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "", + isFav: false,); + setState(() {}); + } }, + icon: getEmployeeSubordinates!.isFavorite != true + ? Icon( + Icons.star_outline, + size: 35, + color: MyColors.green9CColor, + ) + : Icon( + Icons.star_outlined, + size: 35, + color: MyColors.green9CColor, + ), + ), + getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER == "" + ? SvgPicture.asset("assets/images/call-disable.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17) + : InkWell( + onTap:() { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17), + ), ], ), - ), - Container(height: 100, alignment: Alignment.center, child: ProfileImage()), - ]) - ), - Container( - margin: EdgeInsets.fromLTRB(21, 8, 21, 10), - height: 260, - padding: EdgeInsets.only(top: 15, bottom: 15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: const BorderRadius.all(Radius.circular(15)), - boxShadow: [BoxShadow(color: MyColors.lightGreyColor, blurRadius: 15, spreadRadius: 3)], - ), - child: Column( - children: menu.map((ProfileMenu i) => rowItem(i, context)).toList(), + getEmployeeSubordinates!.eMPLOYEENAME!.toText21(maxlines: 2), + ("${getEmployeeSubordinates!.eMPLOYEENUMBER!} | ${getEmployeeSubordinates!.jOBNAME!}").toText13(color: MyColors.grey80Color), + getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS!.toText13(), + ], + ).objectContainerView(), + ), + Container( + height: 68, alignment: Alignment.center, child: ProfileImage()).paddingOnly(top: 10), + ]), + 12.height, + Container( + margin: EdgeInsets.fromLTRB(21, 0, 21, 0), + child: Column( + children: menu.map((ProfileMenu i) => rowItem(i, context)).toList(), + ).objectContainerView(), ), - ), + // ), ], ); } Widget ProfileImage() => - CircleAvatar( + getEmployeeSubordinates?.eMPLOYEEIMAGE == null + ? SvgPicture.asset("assets/images/user.svg",height: 68, width: 68, ) + : CircleAvatar( radius: 70, backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)), backgroundColor: Colors.black, ); - Widget customLabel(String label, double size, Color color, bool isBold, {double padding = 0.0}) => - Container( - padding: EdgeInsets.all(padding), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [Text(label, style: TextStyle(color: color, fontSize: size, fontWeight: isBold ? FontWeight.bold : FontWeight.normal))])); Widget rowItem(obj, context) { return InkWell( @@ -233,7 +210,6 @@ class _EmployeeDetailsState extends State { leading: SvgPicture.asset('assets/images/' + obj.icon), title: Text(obj.name, style: TextStyle(color: MyColors.grey3AColor, - fontWeight: FontWeight.w600, fontSize: 16)), trailing: Icon(Icons.arrow_forward, color: MyColors.grey3AColor,), @@ -242,10 +218,10 @@ class _EmployeeDetailsState extends State { } void setMenu(){ menu = [ - ProfileMenu(name: "Profile Details", icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates), - ProfileMenu(name: "Create Request", icon: "create_request.svg", route: AppRoutes.createRequest,arguments: getEmployeeSubordinates), - ProfileMenu(name: "View Attendance", icon: "view_attendance.svg", route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates), - ProfileMenu(name: "Team Members", icon: "team.svg", route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates), + ProfileMenu(name: LocaleKeys.profileDetails.tr(), icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments:getEmployeeSubordinates), + ProfileMenu(name: LocaleKeys.createRequest.tr(), icon: "create_request.svg", route: AppRoutes.createRequest,arguments: getEmployeeSubordinates), + ProfileMenu(name: LocaleKeys.viewAttendance.tr(), icon: "view_attendance.svg", route: AppRoutes.viewAttendance, arguments: getEmployeeSubordinates), + ProfileMenu(name: LocaleKeys.teamMembers.tr(), icon: "team.svg", route: AppRoutes.teamMembers, arguments: getEmployeeSubordinates), ]; } diff --git a/lib/ui/my_team/my_team.dart b/lib/ui/my_team/my_team.dart index 0842319..4639741 100644 --- a/lib/ui/my_team/my_team.dart +++ b/lib/ui/my_team/my_team.dart @@ -126,42 +126,52 @@ class _MyTeamState extends State { itemCount: _textEditingController!.text.isNotEmpty ? getEmployeeSListOnSearch.length : getEmployeeSubordinatesList.length, itemBuilder: (context, index) { var phoneNumber = Uri.parse('tel:${getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER}'); - return Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - CircleAvatar( - radius: 25, - backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)), - backgroundColor: Colors.black, - ), - 10.width, - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // "Present".toText13(color: MyColors.greenColor), - "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(color: MyColors.grey3AColor), - "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(color: MyColors.grey57Color), - ], - ).expanded, - Column( - children: [ - InkWell( - onTap: () { - launchUrl(phoneNumber); - }, - child: SvgPicture.asset("assets/images/call.svg"), - ), - 21.height, - InkWell( - onTap: () async { - Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]); - }, - child: Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor), - ), - ], - ), - ], - ).objectContainerView(); + return InkWell( + onTap: () async { + Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSListOnSearch[index]); + }, + child: Row( + //mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + getEmployeeSListOnSearch[index].eMPLOYEEIMAGE == null + ? SvgPicture.asset("assets/images/user.svg",height: 34, width: 34, ).paddingOnly(top: 4) + : Container( + height: 34, + width: 34, + child: CircleAvatar( + radius: 25, + backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSListOnSearch[index].eMPLOYEEIMAGE)), + backgroundColor: Colors.black, + ).paddingOnly(top: 4), + ), + 9.width, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // "Present".toText13(color: MyColors.greenColor), + "${getEmployeeSListOnSearch[index].eMPLOYEENAME}".toText16(color: MyColors.grey3AColor), + "${getEmployeeSListOnSearch[index].pOSITIONNAME}".toText10(color: MyColors.grey57Color), + ], + ).expanded, + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + getEmployeeSListOnSearch[index].eMPLOYEEMOBILENUMBER == "" + ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22).paddingOnly(bottom: 23) + : InkWell( + onTap: () { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22).paddingOnly(bottom: 23), + ), + // 21.height, + Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor), + ], + ).expanded, + ], + ).objectContainerView(), + ); }) ], ), diff --git a/lib/ui/my_team/profile_details.dart b/lib/ui/my_team/profile_details.dart index b1bf5df..2ed39ab 100644 --- a/lib/ui/my_team/profile_details.dart +++ b/lib/ui/my_team/profile_details.dart @@ -36,19 +36,19 @@ class _ProfileDetailsState extends State { children: [ Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.category.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.darkTextColor), + "${getEmployeeSubordinates?.eMPLOYMENTCATEGORYMEANING}".toText16(color: MyColors.darkTextColor), 23.height, LocaleKeys.address.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.lOCATIONNAME}".toText16(isBold: true, color: MyColors.darkTextColor), + "${getEmployeeSubordinates?.lOCATIONNAME}".toText16(color: MyColors.darkTextColor), 23.height, LocaleKeys.phoneNumber.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.darkTextColor), + "${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}".toText16(color: MyColors.darkTextColor), 23.height, LocaleKeys.businessGroup.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.darkTextColor), + "${getEmployeeSubordinates?.bUSINESSGROUPNAME}".toText16(color: MyColors.darkTextColor), 23.height, LocaleKeys.Payroll.tr().toText13(color: MyColors.lightGrayColor), - "${getEmployeeSubordinates?.pAYROLLNAME}".toText16(isBold: true, color: MyColors.darkTextColor), + "${getEmployeeSubordinates?.pAYROLLNAME}".toText16(color: MyColors.darkTextColor), ]).objectContainerView(), ], )); diff --git a/lib/ui/my_team/subordinate_leave.dart b/lib/ui/my_team/subordinate_leave.dart index d9ca110..f08193c 100644 --- a/lib/ui/my_team/subordinate_leave.dart +++ b/lib/ui/my_team/subordinate_leave.dart @@ -88,7 +88,9 @@ class _SubordinateLeaveState extends State { ], ).objectContainerView(), if (showList) - ListView.separated( + getSubordinatesLeavesTotalList.isEmpty? + Utils.getNoDataWidget(context).paddingOnly(top: 21) + : ListView.separated( scrollDirection: Axis.vertical, physics: ScrollPhysics(), padding: const EdgeInsets.all(21), @@ -98,9 +100,7 @@ class _SubordinateLeaveState extends State { var diffDays = DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATEEND!) .difference(DateUtil.convertStringToDate(getSubordinatesLeavesTotalList[index].dATESTART!)) .inDays; - return getSubordinatesLeavesTotalList.isEmpty - ? Utils.getNoDataWidget(context) - : Row( + return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ SvgPicture.asset("assets/images/user.svg", width: 34, height: 34).paddingOnly(top: 4), diff --git a/lib/ui/my_team/team_members.dart b/lib/ui/my_team/team_members.dart index 37a779d..cb59ab6 100644 --- a/lib/ui/my_team/team_members.dart +++ b/lib/ui/my_team/team_members.dart @@ -1,5 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.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'; @@ -59,7 +60,9 @@ class _TeamMembersState extends State { child: Column( children: [ getEmployeeSubordinatesList.isEmpty - ? Utils.getNoDataWidget(context): + ? Container( + margin: const EdgeInsets.only(top: 100), + child: Utils.getNoDataWidget(context)): ListView.separated( scrollDirection: Axis.vertical, shrinkWrap: true, @@ -69,40 +72,51 @@ class _TeamMembersState extends State { itemCount: getEmployeeSubordinatesList.length, itemBuilder: (BuildContext context, int index) { var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}'); - return Container( + return InkWell( + onTap: () async { + // Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSubordinatesList[index]); + }, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - CircleAvatar( - radius: 25, - backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)), - backgroundColor: Colors.black, - ), - SizedBox(width: 10,), + getEmployeeSubordinatesList[index].eMPLOYEEIMAGE == null + ? SvgPicture.asset("assets/images/user.svg",height: 34, width: 34, ).paddingOnly(top: 4) + : Container( + height: 34, + width: 34, + child: CircleAvatar( + radius: 25, + backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinatesList[index].eMPLOYEEIMAGE)), + backgroundColor: Colors.black, + ).paddingOnly(top: 4), + ), + 9.width, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ // "Present".toText13(color: MyColors.greenColor), - "${getEmployeeSubordinatesList[index].eMPLOYEENAME}".toText16(isBold: true, color: MyColors.grey3AColor), - "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10(isBold: true, color: MyColors.grey57Color), + "${getEmployeeSubordinatesList[index].eMPLOYEENAME}".toText16(color: MyColors.grey3AColor), + "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10( color: MyColors.grey57Color), ], ).expanded, - Column( - children: [ - IconButton( - onPressed: () { - launchUrl(phoneNumber); - }, - icon: Icon( - Icons.whatsapp, - color: Colors.green, - ), - ), - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER == "" + ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22).paddingOnly(bottom: 23) + :InkWell( + onTap: () { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22).paddingOnly(bottom: 23), + ), + // 21.height, + Icon(Icons.arrow_forward_outlined, color: MyColors.grey3AColor), + ], + ).expanded, ], ), - ).objectContainerView(); + ).objectContainerView(); }), ], )