import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart';

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

class BloodDonationViewModel extends BaseViewModel{



  BloodDonationService _bloodDonationService =locator<BloodDonationService>();
  List<CitiesModel> get CitiesModelList => _bloodDonationService.CitiesModelList;
  Future getCities() async {
    setState(ViewState.Busy);
    await _bloodDonationService.getAllCitiesOrders();
   // getHospitals();
    if (_bloodDonationService.hasError) {
      error = _bloodDonationService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }
}