import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';

import '../../locator.dart';

class PrescriptionDeliveryViewModel extends BaseViewModel{

  CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();

  List<AddressInfo> get addressesList => _customerAddressesService.addressesList;

  Future getCustomerAddresses() async {
    setState(ViewState.Busy);
    await _customerAddressesService.getCustomerAddresses(
    );
    if (_customerAddressesService.hasError) {
      error = _customerAddressesService.error;
      setState(ViewState.ErrorLocal);
    } else {
      setState(ViewState.Idle);
    }
  }


}