phone number inprogress

merge-requests/1/merge
Sultan Khan 3 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,8 +154,7 @@ 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,
children: [ children: [
@ -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,51 +48,104 @@ 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, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 25, right: 25, top: 25),
top: 20, padding: EdgeInsets.all(20),
left: 26, // height: 400,
right: 26, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.0), border: Border.all(color: Color.fromARGB(255, 209, 207, 207))),
), child: InkWell(
padding: EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 20), child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
height: 400, Icon(
decoration: BoxDecoration( Icons.add,
boxShadow: [ color: Color(0xff259CB8),
BoxShadow( ),
color: Colors.grey.withOpacity(0.5), Text(
spreadRadius: 5, 'Add new row',
blurRadius: 26, style: TextStyle(color: Color(0xff259CB8), fontWeight: FontWeight.bold),
offset: Offset(0, 3), )
), ]),
], onTap: () {
color: Colors.white, addNewRow();
borderRadius: BorderRadius.circular(10.0), },
), ),
child: SingleChildScrollView( ),
child: Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList children: widget.getEmployeePhonesList
.map((e) => Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ .map((e) => Container(
PopupMenuButton( width: double.infinity,
child: DynamicTextFieldWidget( margin: EdgeInsets.only(
"Please Select *", top: 20,
e.pHONETYPEMEANING ?? "", left: 26,
isEnable: true, right: 26,
isPopup: true, ),
).paddingOnly(bottom: 12), padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
itemBuilder: (_) => <PopupMenuItem<int>>[ // height: 400,
for (int i = 0; i < getPhoneNumberTypesList.length; i++) PopupMenuItem<int>(child: Text(getPhoneNumberTypesList![i].mEANING!), value: i), decoration: BoxDecoration(
], boxShadow: [
onSelected: (int index) { BoxShadow(
e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING; color: Colors.grey.withOpacity(0.5),
setState(() {}); spreadRadius: 5,
}), blurRadius: 26,
"${e.pHONENUMBER}".toText16(isBold: true, color: MyColors.blackColor), offset: Offset(0, 3),
])) ),
.toList()))) ],
])); color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
PopupMenuButton(
child: DynamicTextFieldWidget(
"Please Select *",
e.pHONETYPEMEANING ?? "",
isEnable: false,
isPopup: true,
).paddingOnly(bottom: 12),
itemBuilder: (_) => <PopupMenuItem<int>>[
for (int i = 0; i < getPhoneNumberTypesList.length; i++) PopupMenuItem<int>(child: Text(getPhoneNumberTypesList![i].mEANING!), value: i),
],
onSelected: (int index) {
e.pHONETYPEMEANING = getPhoneNumberTypesList[index].mEANING;
e.pHONETYPE = getPhoneNumberTypesList[index].cODE;
setState(() {});
}),
DynamicTextFieldWidget(
"",
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