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

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

class BloodDeatailsViewModel extends BaseViewModel{


  BloodDetailsService _bloodDetailsService =locator<BloodDetailsService>();
  List<List_BloodGroupDetailsModel> get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList;


  Future getBlood() async {
    setState(ViewState.Busy);
    await _bloodDetailsService .getAllBloodOrders();;

    if (_bloodDetailsService.hasError) {
      error = _bloodDetailsService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }



}