get operation report

merge-requests/860/head
hussam al-habibeh 4 years ago
parent d035f1ba37
commit ee3d207795

@ -4,7 +4,8 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_
import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart';
class OperationReportService extends BaseService {
List<GetOperationReportModel> get operationReportList => List();
List<GetOperationReportModel> get _operationReportList => List();
List<GetOperationReportModel> get operationReportList => _operationReportList;
Future getOperationReport(
{GetOperationReportRequestModel getOperationReportRequestModel,
@ -16,10 +17,12 @@ class OperationReportService extends BaseService {
await baseAppClient.post(GET_OPERATION_REPORT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
operationReportList.clear();
response['List_OTReservationDetails'].forEach((v) {
operationReportList.add(GetOperationReportModel.fromJson(v));
});
_operationReportList.clear();
response['List_OTReservationDetails'].forEach(
(v) {
_operationReportList.add(GetOperationReportModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -2,13 +2,15 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/operation_report_servive.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart';
class OperationReportViewModel extends BaseViewModel {
bool hasError = false;
OperationReportService _operationReportService =
locator<OperationReportService>();
get operationReportList => _operationReportService.operationReportList;
List<GetOperationReportModel> get operationReportList =>
_operationReportService.operationReportList;
Future getOperationReport(int patientId) async {
hasError = false;

@ -18,7 +18,7 @@ class GetOperationReportModel {
String endDate;
String timeStart;
String timeEnd;
Null remarks;
dynamic remarks;
int status;
int createdBy;
String createdOn;

@ -535,7 +535,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
model
.operationReportList[
index]
.notes,
.remarks,
fontSize: 10,
),
),

Loading…
Cancel
Save