|
|
|
@ -1,11 +1,9 @@
|
|
|
|
import 'dart:collection';
|
|
|
|
|
|
|
|
import 'dart:ui';
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_html/html_parser.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.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/api/my_team/my_team_api_client.dart';
|
|
|
|
import 'package:mohem_flutter_app/api/worklist/worklist_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';
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
@ -19,7 +17,6 @@ import 'package:mohem_flutter_app/models/my_team/get_employee_subordinates_list.
|
|
|
|
import 'package:mohem_flutter_app/models/profile_menu.model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/profile_menu.model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/worklist/get_favorite_replacements_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/worklist/replacement_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +25,6 @@ class EmployeeDetails extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_EmployeeDetailsState createState() => _EmployeeDetailsState();
|
|
|
|
_EmployeeDetailsState createState() => _EmployeeDetailsState();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
@ -62,7 +58,6 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
if (getEmployeeSubordinates == null) {
|
|
|
|
if (getEmployeeSubordinates == null) {
|
|
|
|
@ -70,7 +65,6 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
setMenu();
|
|
|
|
setMenu();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
extendBody: true,
|
|
|
|
extendBody: true,
|
|
|
|
backgroundColor: MyColors.lightGreyEFColor,
|
|
|
|
backgroundColor: MyColors.lightGreyEFColor,
|
|
|
|
@ -118,10 +112,7 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
|
|
|
|
|
|
|
|
Widget myTeamInfo() {
|
|
|
|
Widget myTeamInfo() {
|
|
|
|
Uri phoneNumber = Uri.parse('tel:${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}');
|
|
|
|
Uri phoneNumber = Uri.parse('tel:${getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER}');
|
|
|
|
double _width = MediaQuery
|
|
|
|
double _width = MediaQuery.of(context).size.width;
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width;
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Stack(children: [
|
|
|
|
Stack(children: [
|
|
|
|
@ -133,6 +124,8 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
if (getEmployeeSubordinates!.isFavorite != true) {
|
|
|
|
if (getEmployeeSubordinates!.isFavorite != true) {
|
|
|
|
showFavoriteAlertDialog(context);
|
|
|
|
showFavoriteAlertDialog(context);
|
|
|
|
@ -143,28 +136,32 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
|
|
|
|
employeName: getEmployeeSubordinates!.eMPLOYEENAME ?? "",
|
|
|
|
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
|
|
|
|
image: getEmployeeSubordinates!.eMPLOYEEIMAGE ?? "",
|
|
|
|
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
|
|
|
|
userName: getEmployeeSubordinates!.eMPLOYEENUMBER ?? "",
|
|
|
|
isFav: false,);
|
|
|
|
isFav: false,
|
|
|
|
|
|
|
|
);
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
} },
|
|
|
|
}
|
|
|
|
icon: getEmployeeSubordinates!.isFavorite != true
|
|
|
|
},
|
|
|
|
? Icon(
|
|
|
|
icon: Icon(
|
|
|
|
Icons.star_outline,
|
|
|
|
getEmployeeSubordinates!.isFavorite != true ? Icons.star_outline : Icons.star_outlined,
|
|
|
|
size: 35,
|
|
|
|
|
|
|
|
color: MyColors.green9CColor,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Icon(
|
|
|
|
|
|
|
|
Icons.star_outlined,
|
|
|
|
|
|
|
|
size: 35,
|
|
|
|
size: 35,
|
|
|
|
color: MyColors.green9CColor,
|
|
|
|
color: MyColors.green9CColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER == ""
|
|
|
|
getEmployeeSubordinates?.eMPLOYEEMOBILENUMBER == ""
|
|
|
|
? SvgPicture.asset("assets/images/call-disable.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17)
|
|
|
|
? SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/images/call-disable.svg",
|
|
|
|
|
|
|
|
height: 25,
|
|
|
|
|
|
|
|
width: 25,
|
|
|
|
|
|
|
|
)
|
|
|
|
: InkWell(
|
|
|
|
: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
launchUrl(phoneNumber);
|
|
|
|
launchUrl(phoneNumber);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: SvgPicture.asset("assets/images/call.svg", height: 25, width: 25,).paddingOnly(left:6, right: 17),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/images/call.svg",
|
|
|
|
|
|
|
|
height: 25,
|
|
|
|
|
|
|
|
width: 25,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -172,50 +169,46 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
("${getEmployeeSubordinates!.eMPLOYEENUMBER!} | ${getEmployeeSubordinates!.jOBNAME!}").toText13(color: MyColors.grey80Color),
|
|
|
|
("${getEmployeeSubordinates!.eMPLOYEENUMBER!} | ${getEmployeeSubordinates!.jOBNAME!}").toText13(color: MyColors.grey80Color),
|
|
|
|
getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS!.toText13(),
|
|
|
|
getEmployeeSubordinates!.eMPLOYEEEMAILADDRESS!.toText13(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).objectContainerView(),
|
|
|
|
).paddingOnly(top: 16, bottom: 12, right: 14, left: 14).objectContainerView(radius: 10, disablePadding: true),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(height: 68, alignment: Alignment.center, child: ProfileImage()).paddingOnly(top: 10),
|
|
|
|
height: 68, alignment: Alignment.center, child: ProfileImage()).paddingOnly(top: 10),
|
|
|
|
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
12.height,
|
|
|
|
12.height,
|
|
|
|
Container(
|
|
|
|
ListView.separated(
|
|
|
|
margin: EdgeInsets.fromLTRB(21, 0, 21, 0),
|
|
|
|
padding: EdgeInsets.only(bottom: 21),
|
|
|
|
child: Column(
|
|
|
|
shrinkWrap: true,
|
|
|
|
children: menu.map((ProfileMenu i) => rowItem(i, context)).toList(),
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
).objectContainerView(),
|
|
|
|
itemBuilder: (cxt, index) => Row(
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
// ),
|
|
|
|
SvgPicture.asset('assets/images/' + menu[index].icon, width: 20, height: 20),
|
|
|
|
|
|
|
|
16.width,
|
|
|
|
|
|
|
|
menu[index].name.toText16().expanded,
|
|
|
|
|
|
|
|
16.width,
|
|
|
|
|
|
|
|
const Icon(Icons.arrow_forward, color: MyColors.darkIconColor)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, menu[index].route, arguments: menu[index].arguments);
|
|
|
|
|
|
|
|
}).paddingOnly(left: 21, right: 21, top: 21),
|
|
|
|
|
|
|
|
separatorBuilder: (cxt, index) => 12.height,
|
|
|
|
|
|
|
|
itemCount: menu.length)
|
|
|
|
|
|
|
|
.objectContainerView(disablePadding: true, radius: 10)
|
|
|
|
|
|
|
|
.paddingOnly(left: 21, right: 21),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget ProfileImage() =>
|
|
|
|
Widget ProfileImage() => getEmployeeSubordinates?.eMPLOYEEIMAGE == null
|
|
|
|
getEmployeeSubordinates?.eMPLOYEEIMAGE == null
|
|
|
|
? SvgPicture.asset(
|
|
|
|
? SvgPicture.asset("assets/images/user.svg",height: 68, width: 68, )
|
|
|
|
"assets/images/user.svg",
|
|
|
|
|
|
|
|
height: 68,
|
|
|
|
|
|
|
|
width: 68,
|
|
|
|
|
|
|
|
)
|
|
|
|
: CircleAvatar(
|
|
|
|
: CircleAvatar(
|
|
|
|
radius: 70,
|
|
|
|
radius: 68,
|
|
|
|
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)),
|
|
|
|
backgroundImage: MemoryImage(Utils.getPostBytes(getEmployeeSubordinates?.eMPLOYEEIMAGE)),
|
|
|
|
backgroundColor: Colors.black,
|
|
|
|
backgroundColor: Colors.black,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget rowItem(obj, context) {
|
|
|
|
|
|
|
|
return InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, obj.route, arguments:obj.arguments);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: ListTile(
|
|
|
|
|
|
|
|
leading: SvgPicture.asset('assets/images/' + obj.icon),
|
|
|
|
|
|
|
|
title: Text(obj.name,
|
|
|
|
|
|
|
|
style: TextStyle(color: MyColors.grey3AColor,
|
|
|
|
|
|
|
|
fontSize: 16)),
|
|
|
|
|
|
|
|
trailing: Icon(Icons.arrow_forward,
|
|
|
|
|
|
|
|
color: MyColors.grey3AColor,),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void setMenu() {
|
|
|
|
void setMenu() {
|
|
|
|
menu = [
|
|
|
|
menu = [
|
|
|
|
ProfileMenu(name: LocaleKeys.profileDetails.tr(), icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments: getEmployeeSubordinates),
|
|
|
|
ProfileMenu(name: LocaleKeys.profileDetails.tr(), icon: "profile_details.svg", route: AppRoutes.profileDetails, arguments: getEmployeeSubordinates),
|
|
|
|
@ -290,8 +283,4 @@ class _EmployeeDetailsState extends State<EmployeeDetails> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return GetMenuEntriesList();
|
|
|
|
return GetMenuEntriesList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|