You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
890 B
Dart
24 lines
890 B
Dart
|
4 years ago
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||
|
|
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
|
||
|
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
||
|
|
|
||
|
|
class MostViewedViewModel extends BaseViewModel {
|
||
|
|
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
|
||
|
|
|
||
|
|
List<PharmacyProduct> get mostViewedProducts =>
|
||
|
|
_pharmacyService.mostViewedProducts;
|
||
|
|
|
||
|
|
getMostViewedProducts() async {
|
||
|
|
setState(ViewState.BusyLocal);
|
||
|
|
await _pharmacyService.getMostViewedProducts();
|
||
|
|
// if (_pharmacyService.hasError) {
|
||
|
|
// error = _pharmacyService.error;
|
||
|
|
// setState(ViewState.Error);
|
||
|
|
// } else {
|
||
|
|
setState(ViewState.Idle);
|
||
|
|
// }
|
||
|
|
}
|
||
|
|
}
|