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.
29 lines
970 B
Dart
29 lines
970 B
Dart
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
import 'package:diplomaticquarterapp/core/model/active_medications/ActivePrescriptionReport.dart';
|
|
import 'package:diplomaticquarterapp/core/service/medical/ActiveMedicationsService.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
class ActiveMedicationsViewModel extends BaseViewModel {
|
|
ActiveMedicationsService _activeMedicationsService =
|
|
locator<ActiveMedicationsService>();
|
|
|
|
List<ActivePrescriptionReport> get activePrescriptionReport =>
|
|
_activeMedicationsService.activePrescriptionReport;
|
|
|
|
getActiveMedication() async {
|
|
setState(ViewState.Busy);
|
|
await _activeMedicationsService.getActiveMedication();
|
|
if (_activeMedicationsService.hasError) {
|
|
error = _activeMedicationsService.error;
|
|
setState(ViewState.Error);
|
|
} else {
|
|
setState(ViewState.Idle);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|