|
|
|
|
@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:flutter_webrtc/flutter_webrtc.dart';
|
|
|
|
|
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../locator.dart';
|
|
|
|
|
@ -75,13 +77,17 @@ class PharmacyAddressesViewModel extends BaseViewModel {
|
|
|
|
|
sendingAddress.createdOnUtc = DateTime.now().toString();
|
|
|
|
|
|
|
|
|
|
if (editedAddress == null) {
|
|
|
|
|
|
|
|
|
|
///TODO Fatima*
|
|
|
|
|
await _pharmacyAddressService.addCustomerAddress(sendingAddress);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
await _pharmacyAddressService.editCustomerAddress(sendingAddress);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_pharmacyAddressService.hasError) {
|
|
|
|
|
error = _pharmacyAddressService.error;
|
|
|
|
|
Utils.showErrorToast(error);
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
} else {
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
|