import 'package:hmg_patient_app/core/enum/viewstate.dart';
import 'package:hmg_patient_app/core/model/pharmacies/PharmacyProduct.dart';
import 'package:hmg_patient_app/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:hmg_patient_app/core/viewModels/base_view_model.dart';

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

class LastVisitedViewModel extends BaseViewModel {

  PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();

  List<PharmacyProduct> get lastVisitedProducts =>
      _pharmacyService.lastVisitedProducts;

  getLastVisitedProducts() async {
    setState(ViewState.BusyLocal);
    await _pharmacyService.getLastVisitedProducts();
    // if (_pharmacyService.hasError) {
    //   error = _pharmacyService.error;
    //   setState(ViewState.Error);
    // } else {
      setState(ViewState.Idle);
    // }
  }
}