From ee3d207795daee70063a131121610de997f26487 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Oct 2021 10:11:57 +0300 Subject: [PATCH] get operation report --- lib/core/service/operation_report_servive.dart | 13 ++++++++----- lib/core/viewModel/operation_report_view_model.dart | 4 +++- .../get_operation_report_model.dart | 2 +- .../profile/operation_report/operation_report.dart | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 5094fbb1..30b76cc7 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -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 get operationReportList => List(); + List get _operationReportList => List(); + List 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; diff --git a/lib/core/viewModel/operation_report_view_model.dart b/lib/core/viewModel/operation_report_view_model.dart index 673d6522..246eff87 100644 --- a/lib/core/viewModel/operation_report_view_model.dart +++ b/lib/core/viewModel/operation_report_view_model.dart @@ -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(); - get operationReportList => _operationReportService.operationReportList; + List get operationReportList => + _operationReportService.operationReportList; Future getOperationReport(int patientId) async { hasError = false; diff --git a/lib/models/operation_report/get_operation_report_model.dart b/lib/models/operation_report/get_operation_report_model.dart index 4a84620c..29a0158c 100644 --- a/lib/models/operation_report/get_operation_report_model.dart +++ b/lib/models/operation_report/get_operation_report_model.dart @@ -18,7 +18,7 @@ class GetOperationReportModel { String endDate; String timeStart; String timeEnd; - Null remarks; + dynamic remarks; int status; int createdBy; String createdOn; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 427c6f7e..04b271b5 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -535,7 +535,7 @@ class _ProgressNoteState extends State { model .operationReportList[ index] - .notes, + .remarks, fontSize: 10, ), ),