import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';

class UserInformationViewModel extends BaseViewModel {
  UserInformationService _userInformationService =
      locator<UserInformationService>();

  List<List_UserInformationModel> get userInformationModelList =>
      _userInformationService.userInformationModelList;

  getUserInformationRequestOrders() async {
    setState(ViewState.Busy);
    await _userInformationService.getUserInformationOrders();
    if (_userInformationService.hasError) {
      error = _userInformationService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }
}
