import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';

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

class HospitalViewModel extends BaseViewModel {
  HospitalsService _hospitalsService = locator<HospitalsService>();

  // List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
  // get loginInfo => _authService.loginInfo;
  Future getHospitalsList(memberID) async {
    GetHospitalsRequestModel getHospitalsRequestModel =
        GetHospitalsRequestModel();
    getHospitalsRequestModel.memberID = memberID;
    setState(ViewState.Busy);
    await _hospitalsService.getHospitals(getHospitalsRequestModel);
    if (_hospitalsService.hasError) {
      error = _hospitalsService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }
}
