|
|
|
@ -1,23 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/src/public_ext.dart';
|
|
|
|
import 'package:easy_localization/src/public_ext.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:mohem_flutter_app/api/profile_api_client.dart';
|
|
|
|
import 'package:mohem_flutter_app/api/profile_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';
|
|
|
|
import 'package:mohem_flutter_app/dialogs/otp_dialog.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/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/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_contacts.model.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_familyMembers_screen.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/profile/dynamic_screens/dynamic_input_profile_screen.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/ui/profile/profile.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/profile/profile.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
|
|
|
@ -30,15 +20,14 @@ class FamilyMembers extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
|
|
|
|
|
|
|
|
List<GetEmployeeContactsList> getEmployeeContactsList = [];
|
|
|
|
List<GetEmployeeContactsList> getEmployeeContactsList = [];
|
|
|
|
|
|
|
|
|
|
|
|
int? relationId;
|
|
|
|
int? relationId;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
getEmployeeContacts();
|
|
|
|
getEmployeeContacts();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void getEmployeeContacts() async {
|
|
|
|
void getEmployeeContacts() async {
|
|
|
|
@ -53,7 +42,6 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBarWidget(
|
|
|
|
appBar: AppBarWidget(
|
|
|
|
@ -61,7 +49,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
title: LocaleKeys.profile_familyDetails.tr(),
|
|
|
|
title: LocaleKeys.profile_familyDetails.tr(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
backgroundColor: MyColors.backgroundColor,
|
|
|
|
backgroundColor: MyColors.backgroundColor,
|
|
|
|
bottomSheet:footer(),
|
|
|
|
bottomSheet: footer(),
|
|
|
|
body: Container(
|
|
|
|
body: Container(
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
child: getEmployeeContactsList.length != 0
|
|
|
|
child: getEmployeeContactsList.length != 0
|
|
|
|
@ -80,8 +68,16 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.only(top: 20, left: 21, right: 21,),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 14, right: 14,top: 13, ),
|
|
|
|
top: 20,
|
|
|
|
|
|
|
|
left: 21,
|
|
|
|
|
|
|
|
right: 21,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 14,
|
|
|
|
|
|
|
|
right: 14,
|
|
|
|
|
|
|
|
top: 13,
|
|
|
|
|
|
|
|
),
|
|
|
|
height: 110,
|
|
|
|
height: 110,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
boxShadow: [
|
|
|
|
boxShadow: [
|
|
|
|
@ -95,12 +91,12 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
"${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor),
|
|
|
|
"${getEmployeeContactsList[index].cONTACTNAME}".toText16(color: MyColors.blackColor),
|
|
|
|
"${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
|
|
|
|
"${getEmployeeContactsList[index].rELATIONSHIP}".toText11(isBold: true, color: MyColors.textMixColor),
|
|
|
|
SizedBox(height: 5,),
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 5,
|
|
|
|
|
|
|
|
),
|
|
|
|
Divider(
|
|
|
|
Divider(
|
|
|
|
color: MyColors.lightGreyEFColor,
|
|
|
|
color: MyColors.lightGreyEFColor,
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
@ -137,8 +133,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
child: SizedBox(
|
|
|
|
child: SizedBox(
|
|
|
|
@ -164,7 +159,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text:LocaleKeys.remove.tr(),
|
|
|
|
text: LocaleKeys.remove.tr(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColors.DarkRedColor,
|
|
|
|
color: MyColors.DarkRedColor,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
@ -174,8 +169,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
|
|
|
|
// ElevatedButton.icon(
|
|
|
|
// ElevatedButton.icon(
|
|
|
|
// icon: Icon(
|
|
|
|
// icon: Icon(
|
|
|
|
// Icons.delete,
|
|
|
|
// Icons.delete,
|
|
|
|
@ -191,24 +185,20 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
));
|
|
|
|
);
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
):Container(),
|
|
|
|
|
|
|
|
// SizedBox(height: 20),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
: Container(),
|
|
|
|
|
|
|
|
// SizedBox(height: 20),
|
|
|
|
);
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
footer(){
|
|
|
|
Widget footer() {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
@ -224,21 +214,27 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showUpdateAlertDialog(BuildContext context) {
|
|
|
|
void showUpdateAlertDialog(BuildContext context) {
|
|
|
|
Widget cancelButton = TextButton(
|
|
|
|
Widget cancelButton = TextButton(
|
|
|
|
child: Text(LocaleKeys.cancel.tr(),),
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
LocaleKeys.cancel.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
Widget continueButton = TextButton(
|
|
|
|
Widget continueButton = TextButton(
|
|
|
|
child: Text(LocaleKeys.ok.tr(),),
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
LocaleKeys.ok.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
continueDynamicForms();
|
|
|
|
continueDynamicForms();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
AlertDialog alert = AlertDialog(
|
|
|
|
AlertDialog alert = AlertDialog(
|
|
|
|
title: Text(LocaleKeys.confirm.tr(),),
|
|
|
|
title: Text(
|
|
|
|
|
|
|
|
LocaleKeys.confirm.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
content: Text("Are You Sure You Want to Update this Member?"),
|
|
|
|
content: Text("Are You Sure You Want to Update this Member?"),
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
cancelButton,
|
|
|
|
cancelButton,
|
|
|
|
@ -252,22 +248,29 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showRemoveAlertDialog(BuildContext context,int relationId) {
|
|
|
|
|
|
|
|
|
|
|
|
void showRemoveAlertDialog(BuildContext context, int relationId) {
|
|
|
|
Widget cancelButton = TextButton(
|
|
|
|
Widget cancelButton = TextButton(
|
|
|
|
child: Text(LocaleKeys.cancel.tr(),),
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
LocaleKeys.cancel.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
Widget continueButton = TextButton(
|
|
|
|
Widget continueButton = TextButton(
|
|
|
|
child: Text(LocaleKeys.ok.tr(),),
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
LocaleKeys.ok.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember);
|
|
|
|
Navigator.pushNamed(context, AppRoutes.deleteFamilyMember);
|
|
|
|
// continueDynamicForms();
|
|
|
|
// continueDynamicForms();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
AlertDialog alert = AlertDialog(
|
|
|
|
AlertDialog alert = AlertDialog(
|
|
|
|
title: Text(LocaleKeys.confirm.tr(),),
|
|
|
|
title: Text(
|
|
|
|
|
|
|
|
LocaleKeys.confirm.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
content: Text("Are You Sure You Want to Remove this Member?"),
|
|
|
|
content: Text("Are You Sure You Want to Remove this Member?"),
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
cancelButton,
|
|
|
|
cancelButton,
|
|
|
|
@ -282,10 +285,7 @@ class _FamilyMembersState extends State<FamilyMembers> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void continueDynamicForms() {
|
|
|
|
void continueDynamicForms() {
|
|
|
|
Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile,
|
|
|
|
Navigator.pushNamed(context, AppRoutes.addDynamicInputProfile, arguments: DynamicFamilyMembersParams(LocaleKeys.profile_familyDetails.tr(), getEmployeeContactsList: getEmployeeContactsList));
|
|
|
|
arguments: DynamicFamilyMembersParams(LocaleKeys.profile_familyDetails.tr(), getEmployeeContactsList: getEmployeeContactsList));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|