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.
34 lines
1.0 KiB
Dart
34 lines
1.0 KiB
Dart
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
|
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
|
|
|
import '../../locator.dart';
|
|
|
|
class DashboardViewModel extends BaseViewModel {
|
|
VitalSignService _vitalSignService = locator<VitalSignService>();
|
|
|
|
String get weightKg => _vitalSignService.weightKg;
|
|
|
|
String get heightCm => _vitalSignService.heightCm;
|
|
String booldType = "-";
|
|
|
|
DashboardViewModel() {
|
|
// this.getPatientRadOrders();
|
|
}
|
|
|
|
getPatientRadOrders() async {
|
|
if (isLogin && _vitalSignService.weightKg.isEmpty) {
|
|
setState(ViewState.Busy);
|
|
await _vitalSignService.getPatientRadOrders();
|
|
if (_vitalSignService.hasError) {
|
|
error = _vitalSignService.error;
|
|
setState(ViewState.ErrorLocal);
|
|
} else {
|
|
booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-";
|
|
setState(ViewState.Idle);
|
|
}
|
|
}
|
|
}
|
|
}
|