fix as first step

merge-requests/542/head
Elham Rababh 4 years ago
parent 6439fe264a
commit 12e47aba82

@ -544,8 +544,8 @@ const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "deletecustomeraddress";
const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";

@ -65,12 +65,12 @@ class CustomerAddressesService extends BaseService {
class CustomerInfo {
bool isRegistered;
String userName;
dynamic userName;
dynamic password;
String email;
dynamic email;
dynamic errorMessage;
String mobileNumber;
int customerId;
dynamic mobileNumber;
dynamic customerId;
CustomerInfo({this.isRegistered, this.userName, this.password, this.email, this.errorMessage, this.mobileNumber, this.customerId});
@ -103,7 +103,7 @@ class AddressInfo {
String lastName;
String email;
dynamic company;
int countryId;
dynamic countryId;
String country;
dynamic stateProvinceId;
String city;

@ -75,7 +75,6 @@ class PharmacyAddressesViewModel extends BaseViewModel {
sendingAddress.faxNumber = user.faxNumber;
sendingAddress.customerAttributes = "";
sendingAddress.createdOnUtc = DateTime.now().toString();
if (editedAddress == null) {
///TODO Fatima*
@ -83,15 +82,21 @@ class PharmacyAddressesViewModel extends BaseViewModel {
} else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress);
}
if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error;
Utils.showErrorToast(error);
setState(ViewState.Error);
await _pharmacyAddressService.getAddresses();
setState(ViewState.Idle);
// setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future deleteAddresses(AddressInfo sendingAddress) async {

@ -34,9 +34,11 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
Navigator.push(
ctx,
FadePage(
page: AddAddressPage(address, (pickResult) {
page: AddAddressPage(address, (pickResult) async {
model.addEditAddress(pickResult, address);
})));
await model.getAddressesList();
})));
}
Widget build(BuildContext context) {

@ -71,7 +71,10 @@ class PharmacyAddressService extends BaseService {
}
Future addCustomerAddress(AddressInfo address) async {
makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
// if(!hasError) {
selectedAddressIndex = addresses.length +1;
// }
}
Future editCustomerAddress(AddressInfo address) async {

Loading…
Cancel
Save