diff --git a/lib/models/generic_response_model.dart b/lib/models/generic_response_model.dart index 40da7d0..decadfa 100644 --- a/lib/models/generic_response_model.dart +++ b/lib/models/generic_response_model.dart @@ -669,9 +669,9 @@ class GenericResponseModel { } getEarningsList = json['GetEarningsList']; if (json['GetEmployeeAddressList'] != null) { - getEmployeeAddressList = [].cast(); + getEmployeeAddressList = []; json['GetEmployeeAddressList'].forEach((v) { - getEmployeeAddressList!.add(v); + getEmployeeAddressList!.add(new GetEmployeeAddressList.fromJson(v)); }); } if (json['GetEmployeeBasicDetailsList'] != null) { diff --git a/lib/ui/profile/personal_info.dart b/lib/ui/profile/personal_info.dart index d21c5ed..e2abba0 100644 --- a/lib/ui/profile/personal_info.dart +++ b/lib/ui/profile/personal_info.dart @@ -2,6 +2,7 @@ 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/app_state/app_state.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'; @@ -27,12 +28,18 @@ class _PesonalInfoState extends State { String? emailAddress = ""; String? employeeNo = ""; + // List getEmployeeBasicDetailsList = []; + // MemberInformationListModel? _memberInformationList; + + late MemberInformationListModel memberInformationList; + List getEmployeeBasicDetailsList = []; - MemberInformationListModel? _memberInformationList; + @override void initState() { super.initState(); + memberInformationList = AppState().memberInformationList!; } @@ -80,23 +87,23 @@ class _PesonalInfoState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ "Category".toText13(color: MyColors.lightGrayColor), - "${_memberInformationList!.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.blackColor), + "${memberInformationList!.eMPLOYMENTCATEGORYMEANING}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), "Address".toText13(color: MyColors.lightGrayColor), - "${_memberInformationList!.lOCATIONNAME}".toText16(isBold: true, color: MyColors.blackColor), + "${memberInformationList!.lOCATIONNAME}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), "Phone Number".toText13(color: MyColors.lightGrayColor), - "${_memberInformationList!.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.blackColor), + "${memberInformationList!.eMPLOYEEMOBILENUMBER}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), "Business Group".toText13(color: MyColors.lightGrayColor), - "${_memberInformationList!.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.blackColor), + "${memberInformationList!.bUSINESSGROUPNAME}".toText16(isBold: true, color: MyColors.blackColor), SizedBox( height: 20,), "Payroll".toText13(color: MyColors.lightGrayColor), - "${_memberInformationList!.pAYROLLNAME}".toText16(isBold: true, color: MyColors.blackColor), + "${memberInformationList!.pAYROLLNAME}".toText16(isBold: true, color: MyColors.blackColor), ] ), ),