diff --git a/lib/classes/date_uitl.dart b/lib/classes/date_uitl.dart index a1e52d9..29edb2f 100644 --- a/lib/classes/date_uitl.dart +++ b/lib/classes/date_uitl.dart @@ -40,7 +40,7 @@ class DateUtil { } static DateTime convertSimpleStringDateToDate(String date) { - return DateFormat("MM/dd/yyyy hh:mm:ss").parse(date); + return DateFormat("MM/dd/yyyy hh:mm:ss a").parse(date.toUpperCase()); } static DateTime convertSimpleStringDateToDateddMMyyyy(String date) { diff --git a/lib/ui/my_team/team_members.dart b/lib/ui/my_team/team_members.dart index f6d33d8..c4defc4 100644 --- a/lib/ui/my_team/team_members.dart +++ b/lib/ui/my_team/team_members.dart @@ -15,6 +15,7 @@ import 'package:url_launcher/url_launcher.dart'; class TeamMembers extends StatefulWidget { final String? selectedEmp; + const TeamMembers({this.selectedEmp, Key? key}) : super(key: key); @override @@ -22,8 +23,8 @@ class TeamMembers extends StatefulWidget { } class _TeamMembersState extends State { - String searchEmpEmail =""; - String searchEmpName =""; + String searchEmpEmail = ""; + String searchEmpName = ""; String searchEmpNo = ""; String? empId; @@ -32,14 +33,14 @@ class _TeamMembersState extends State { void initState() { super.initState(); - employeeSubordinates(); + employeeSubordinates(); } void employeeSubordinates() async { try { Utils.showLoading(context); getEmployeeSubordinatesList = await MyTeamApiClient().getEmployeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString()); - getEmployeeSubordinatesList = await MyTeamApiClient().employeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString(),getEmployeeSubordinates?.eMPLOYEENUMBER); + getEmployeeSubordinatesList = await MyTeamApiClient().employeeSubordinates(searchEmpEmail.toString(), searchEmpName.toString(), searchEmpNo.toString(), getEmployeeSubordinates?.eMPLOYEENUMBER); Utils.hideLoading(context); setState(() {}); } catch (ex) { @@ -52,80 +53,83 @@ class _TeamMembersState extends State { Widget build(BuildContext context) { getEmployeeSubordinates ??= ModalRoute.of(context)?.settings.arguments as GetEmployeeSubordinatesList; return Scaffold( - appBar: AppBarWidget( - context, - title: LocaleKeys.teamMembers.tr(), + appBar: AppBarWidget( + context, + title: LocaleKeys.teamMembers.tr(), + ), + backgroundColor: MyColors.backgroundColor, + body: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + getEmployeeSubordinatesList.isEmpty + ? Container(margin: const EdgeInsets.only(top: 100), child: Utils.getNoDataWidget(context)) + : ListView.separated( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: const EdgeInsets.only(top: 12), + separatorBuilder: (BuildContext cxt, int index) => 12.height, + itemCount: getEmployeeSubordinatesList.length, + itemBuilder: (BuildContext context, int index) { + var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}'); + return InkWell( + onTap: () async { + Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSubordinatesList[index]); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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.dataFromBase64String(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(color: MyColors.grey3AColor), + "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10(color: MyColors.grey57Color), + ], + ).expanded, + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER == "" + ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22) + : InkWell( + onTap: () { + launchUrl(phoneNumber); + }, + child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22), + ), + 8.height, + const Icon( + Icons.arrow_forward_outlined, + color: MyColors.grey3AColor, + size: 18, + ), + ], + ), + ], + ).paddingOnly(top: 13, bottom: 13, right: 12, left: 14).objectContainerView(radius: 10, disablePadding: true), + ).paddingOnly(left: 16.0, right: 16.0); + }), + ], ), - backgroundColor: MyColors.backgroundColor, - body: SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Column( - children: [ - getEmployeeSubordinatesList.isEmpty - ? Container( - margin: const EdgeInsets.only(top: 100), - child: Utils.getNoDataWidget(context)): - ListView.separated( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - padding: const EdgeInsets.only(top: 12), - separatorBuilder: (BuildContext cxt,int index) => 12.height, - itemCount: getEmployeeSubordinatesList.length, - itemBuilder: (BuildContext context, int index) { - var phoneNumber = Uri.parse('tel:${getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER}'); - return InkWell( - onTap: () async { - Navigator.pushNamed(context, AppRoutes.employeeDetails, arguments: getEmployeeSubordinatesList[index]); - }, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 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.dataFromBase64String(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(color: MyColors.grey3AColor), - "${getEmployeeSubordinatesList[index].pOSITIONNAME}".toText10( color: MyColors.grey57Color), - ], - ).expanded, - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - getEmployeeSubordinatesList[index].eMPLOYEEMOBILENUMBER == "" - ? SvgPicture.asset("assets/images/call-disable.svg", width: 22, height: 22) - :InkWell( - onTap: () { - launchUrl(phoneNumber); - }, - child: SvgPicture.asset("assets/images/call.svg", width: 22, height: 22), - ), - 8.height, - const Icon( - Icons.arrow_forward_outlined, - color: MyColors.grey3AColor, - size: 18, - ), - ], - ), - ], - ).paddingOnly(top: 13, bottom: 13, right: 12, left: 14).objectContainerView(radius: 10, disablePadding: true), - ); - }), - ], - ) - )); + ), + ); } }