phone number inprogress

faiz_marathon_signalR_critical
Sultan Khan 4 years ago
parent 88d2e05ae7
commit 794cd2b1e8

@ -30,7 +30,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized();
await Firebase.initializeApp();
AppState().setPostParamsModel(
PostParamsModel(channel: 31, versionID: 3.4, mobileType: Platform.isAndroid ? "android" : "ios"),
PostParamsModel(channel: 31, versionID: 3.6, mobileType: Platform.isAndroid ? "android" : "ios"),
);
runApp(
EasyLocalization(

@ -1,4 +1,3 @@
class GetEmployeePhonesList {
String? dATEFROM;
String? dATETO;
@ -10,20 +9,12 @@ class GetEmployeePhonesList {
String? pHONETYPE;
String? pHONETYPEMEANING;
int? rOWINDEX;
String? aCTION;
GetEmployeePhonesList(
{this.dATEFROM,
this.dATETO,
this.oBJECTVERSIONNUMBER,
this.pARENTID,
this.pARENTTABLE,
this.pHONEID,
this.pHONENUMBER,
this.pHONETYPE,
this.pHONETYPEMEANING,
this.rOWINDEX});
{this.aCTION, this.dATEFROM, this.dATETO, this.oBJECTVERSIONNUMBER, this.pARENTID, this.pARENTTABLE, this.pHONEID, this.pHONENUMBER, this.pHONETYPE, this.pHONETYPEMEANING, this.rOWINDEX});
GetEmployeePhonesList.fromJson(Map<String, dynamic> json) {
aCTION = json['ACTION'];
dATEFROM = json['DATE_FROM'];
dATETO = json['DATE_TO'];
oBJECTVERSIONNUMBER = json['OBJECT_VERSION_NUMBER'];
@ -38,6 +29,7 @@ class GetEmployeePhonesList {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ACTION'] = this.aCTION;
data['DATE_FROM'] = this.dATEFROM;
data['DATE_TO'] = this.dATETO;
data['OBJECT_VERSION_NUMBER'] = this.oBJECTVERSIONNUMBER;

@ -75,7 +75,8 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.getEmployeePhonesList
.map((e) => Container(
.map((e) => e.aCTION != 'DELETE_ROW'
? Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 20,
@ -133,14 +134,17 @@ class _PhoneNumbersState extends State<PhoneNumbers> {
)
]),
onTap: () {
widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
setState(() {});
// widget.getEmployeePhonesList.removeWhere((item) => item.pHONEID == e.pHONEID);
setState(() {
deleteRow(e);
});
},
),
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';
}
}

Loading…
Cancel
Save