|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/src/public_ext.dart';
|
|
|
|
|
import 'package:flutter/material.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/utils.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/widget_extensions.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_address_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_basic_details.model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/get_employee_phones_model.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/button/default_button.dart';
|
|
|
|
|
|
|
|
|
|
class ContactDetails extends StatefulWidget {
|
|
|
|
|
const ContactDetails({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_ContactDetailsState createState() => _ContactDetailsState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ContactDetailsState extends State<ContactDetails> {
|
|
|
|
|
String? fullName = "";
|
|
|
|
|
String? maritalStatus = "";
|
|
|
|
|
String? birthDate = "";
|
|
|
|
|
String? civilIdentityNumber = "";
|
|
|
|
|
String? emailAddress = "";
|
|
|
|
|
String? employeeNo = "";
|
|
|
|
|
|
|
|
|
|
List<GetEmployeePhonesList> getEmployeePhonesList = [];
|
|
|
|
|
List<GetEmployeeAddressList> getEmployeeAddressList = [];
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
getEmployeePhones();
|
|
|
|
|
getEmployeeAddress();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getEmployeePhones() async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
getEmployeePhonesList = await ProfileApiClient().getEmployeePhones();
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getEmployeeAddress() async {
|
|
|
|
|
try {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
getEmployeeAddressList = await ProfileApiClient().getEmployeeAddress();
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
setState(() {});
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBarWidget(
|
|
|
|
|
context,
|
|
|
|
|
title: LocaleKeys.profile_contactDetails.tr(),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: MyColors.backgroundColor,
|
|
|
|
|
bottomSheet:footer(),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 28, left: 26, right: 26,),
|
|
|
|
|
padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20),
|
|
|
|
|
height: 150,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey.withOpacity(0.5),
|
|
|
|
|
spreadRadius: 5,
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: Offset(0, 3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"${getEmployeePhonesList[0].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeePhonesList[0].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeePhonesList[1].pHONETYPEMEANING}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeePhonesList[1].pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 28, left: 26, right: 26,),
|
|
|
|
|
padding: EdgeInsets.only(left: 14, right: 14,top: 13, bottom: 20),
|
|
|
|
|
height: 400,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey.withOpacity(0.5),
|
|
|
|
|
spreadRadius: 5,
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: Offset(0, 3),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeeAddressList[2].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[2].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeeAddressList[3].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[3].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeeAddressList[4].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[4].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeeAddressList[5].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[5].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,),
|
|
|
|
|
"${getEmployeeAddressList[6].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
|
|
|
|
|
"${getEmployeeAddressList[6].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
footer(){
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(color: MyColors.lightGreyEFColor, spreadRadius: 3),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: DefaultButton(LocaleKeys.update.tr(), () async {
|
|
|
|
|
// context.setLocale(const Locale("en", "US")); // to change Loacle
|
|
|
|
|
Profile();
|
|
|
|
|
}).insideContainer,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|