|
|
|
|
@ -75,72 +75,76 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: widget.getEmployeePhonesList
|
|
|
|
|
.map((e) => Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 20,
|
|
|
|
|
left: 26,
|
|
|
|
|
right: 26,
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
|
|
|
|
|
// height: 400,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Colors.grey.withOpacity(0.5),
|
|
|
|
|
spreadRadius: 5,
|
|
|
|
|
blurRadius: 26,
|
|
|
|
|
offset: Offset(0, 3),
|
|
|
|
|
.map((e) => e.aCTION != 'DELETE_ROW'
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 20,
|
|
|
|
|
left: 26,
|
|
|
|
|
right: 26,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
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,
|
|
|
|
|
padding: EdgeInsets.only(left: 14, right: 14, top: 15, bottom: 15),
|
|
|
|
|
// 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: [
|
|
|
|
|
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),
|
|
|
|
|
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,
|
|
|
|
|
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(() {
|
|
|
|
|
deleteRow(e);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Delete',
|
|
|
|
|
style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
onTap: () {
|
|
|
|
|
widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
])))
|
|
|
|
|
]))
|
|
|
|
|
: Container())
|
|
|
|
|
.toList()),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 80,
|
|
|
|
|
@ -158,16 +162,24 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
child: DefaultButton(LocaleKeys.update.tr(), () async {
|
|
|
|
|
updatePhone();
|
|
|
|
|
// context.setLocale(const Locale("en", "US")); // to change Loacle
|
|
|
|
|
Profile();
|
|
|
|
|
// Profile();
|
|
|
|
|
}).insideContainer,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatePhone() {}
|
|
|
|
|
void updatePhone() {
|
|
|
|
|
print(widget.getEmployeePhonesList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addNewRow() {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.getEmployeePhonesList.add(GetEmployeePhonesList());
|
|
|
|
|
widget.getEmployeePhonesList.add(GetEmployeePhonesList(aCTION: 'NEW_ROW'));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void deleteRow(GetEmployeePhonesList row) {
|
|
|
|
|
row.aCTION = 'DELETE_ROW';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|