phone number inprogress

merge-requests/1/merge
Sultan Khan 4 years ago
parent 979879a286
commit 91a67638c4

@ -122,10 +122,7 @@ class ProfileApiClient {
Future<List<GetPhoneNumberTypesModel>> getPhoneNumberTypes() async { Future<List<GetPhoneNumberTypesModel>> getPhoneNumberTypes() async {
String url = "${ApiConsts.erpRest}GET_OBJECT_VALUES"; String url = "${ApiConsts.erpRest}GET_OBJECT_VALUES";
Map<String, dynamic> postParams = { Map<String, dynamic> postParams = {"P_MENU_TYPE": "E", "P_SELECTED_RESP_ID": -999, "P_OBJECT_NAME": "PHONE_TYPE", "P_OBJECT_TYPE": "LOOKUP"};
"P_MENU_TYPE": "E",
"P_SELECTED_RESP_ID": -999,
};
postParams.addAll(AppState().postParamsJson); postParams.addAll(AppState().postParamsJson);
return await ApiClient().postJsonForObject((json) { return await ApiClient().postJsonForObject((json) {
GenericResponseModel? responseData = GenericResponseModel.fromJson(json); GenericResponseModel? responseData = GenericResponseModel.fromJson(json);

@ -75,7 +75,8 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(), bottomSheet: footer(),
body: Column(children: [ body: SingleChildScrollView(
child: Column(children: [
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -84,7 +85,8 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 26, right: 26,
), ),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20),
height: 200,
///height: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -139,7 +141,7 @@ class _ContactDetailsState extends State<ContactDetails> {
right: 26, right: 26,
), ),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20),
height: 400, // height: 400,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -152,7 +154,6 @@ class _ContactDetailsState extends State<ContactDetails> {
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
child: SingleChildScrollView(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -177,7 +178,7 @@ class _ContactDetailsState extends State<ContactDetails> {
), ),
])) ]))
.toList()) .toList())
]))) ]))
// "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor), // "${getEmployeeAddressList[0].sEGMENTPROMPT}".toText13(color: MyColors.lightGrayColor),
// "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor), // "${getEmployeeAddressList[0].sEGMENTVALUEDSP}".toText16(isBold: true, color: MyColors.blackColor),
// SizedBox( // SizedBox(
@ -208,7 +209,7 @@ class _ContactDetailsState extends State<ContactDetails> {
//]), //]),
//), //),
//], //],
])); ])));
} }
footer() { footer() {

@ -48,16 +48,42 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
), ),
backgroundColor: MyColors.backgroundColor, backgroundColor: MyColors.backgroundColor,
bottomSheet: footer(), bottomSheet: footer(),
body: Column(children: [ body: SingleChildScrollView(
child: Column(children: [
Container( Container(
width: double.infinity,
margin: EdgeInsets.only(left: 25, right: 25, top: 25),
padding: EdgeInsets.all(20),
// height: 400,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.0), border: Border.all(color: Color.fromARGB(255, 209, 207, 207))),
child: InkWell(
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Icon(
Icons.add,
color: Color(0xff259CB8),
),
Text(
'Add new row',
style: TextStyle(color: Color(0xff259CB8), fontWeight: FontWeight.bold),
)
]),
onTap: () {
addNewRow();
},
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList
.map((e) => Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 20, top: 20,
left: 26, left: 26,
right: 26, right: 26,
), ),
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
height: 400, // height: 400,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -70,16 +96,12 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
child: SingleChildScrollView( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList
.map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
PopupMenuButton( PopupMenuButton(
child: DynamicTextFieldWidget( child: DynamicTextFieldWidget(
"Please Select *", "Please Select *",
e.pHONETYPEMEANING ?? "", e.pHONETYPEMEANING ?? "",
isEnable: true, isEnable: false,
isPopup: true, isPopup: true,
).paddingOnly(bottom: 12), ).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[ itemBuilder: (_) => <PopupMenuItem<int>>[
@ -87,12 +109,43 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
], ],
onSelected: (int index) { onSelected: (int index) {
e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING; e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING;
e.pHONETYPE = getPhoneNumberTypesList[index].cODE;
setState(() {}); setState(() {});
}), }),
"${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), DynamicTextFieldWidget(
])) "",
.toList()))) e.pHONENUMBER ?? "",
])); isReadOnly: false,
onChange: (text) {
e.pHONENUMBER = text;
},
).paddingOnly(bottom: 12),
InkWell(
child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Icon(
Icons.delete,
color: Colors.red,
size: 18,
),
Text(
'Delete',
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
)
]),
onTap: () {
widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
setState(() {});
},
),
SizedBox(
height: 10,
),
])))
.toList()),
SizedBox(
height: 80,
)
])));
} }
footer() { footer() {
@ -112,4 +165,9 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
} }
updatePhone() {} updatePhone() {}
void addNewRow() {
setState(() {
widget.getEmployeePhonesList.add(GetEmployeePhonesList());
});
}
} }

Loading…
Cancel
Save