import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart';

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


class VaccinationTableViewModel extends BaseViewModel{

  VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();

   //  String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
  //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
  List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
  getCreateVaccinationTable() async {
    setState(ViewState.Busy);

    await  _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders();

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

}
