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

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

class BrandViewModel extends BaseViewModel {
  PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();

  List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;

  Future getTopManufacturerList() async {
    setState(ViewState.Busy);
    await _pharmacyService.getTopManufacturerList();
    if (_pharmacyService.hasError) {
      error = _pharmacyService.error;
      setState(ViewState.Error);
    } else {
      setState(ViewState.Idle);
    }
  }

  @override
  void dispose() {

    super.dispose();
  }
}
