|
|
|
@ -91,11 +91,11 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
|
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<EmployeeDetails> {
|
|
|
|
|
.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<EmployeeDetails> {
|
|
|
|
|
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<EmployeeDetails> {
|
|
|
|
|
}
|
|
|
|
|
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),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|