fix issues on episode

sick_leave_flutter_2
Elham Rababh 4 years ago
parent 6d445fd72c
commit c4b638e75b

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:collection/collection.dart';
class LiveCarePatientServices extends BaseService {
List<PatiantInformtion> _patientList = [];
@ -47,7 +48,7 @@ class LiveCarePatientServices extends BaseService {
/// add new items.
localPatientList.forEach((element) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) {
if ((_patientList.firstWhereOrNull((it) => it.patientId == element.patientId)) == null) {
_patientList.add(element);
}
});
@ -55,7 +56,7 @@ class LiveCarePatientServices extends BaseService {
/// remove items.
List<PatiantInformtion> removedPatientList = [];
_patientList.forEach((element) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) {
if ((localPatientList.firstWhereOrNull((it) => it.patientId == element.patientId)) == null) {
removedPatientList.add(element);
}
});

@ -23,6 +23,8 @@ import '../shared_soap_widgets/expandable_SOAP_widget.dart';
import 'add_examination_page.dart';
import 'examination_item_card.dart';
import 'objective_call_back.dart';
import 'package:collection/collection.dart';
class UpdateObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
@ -320,7 +322,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
setState(() {
{
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
if ((mySelectedExamination.firstWhereOrNull(
(it) =>
it.selectedExamination!.id ==
element.selectedExamination!.id)) ==
@ -332,7 +334,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
if ((mySelectedExaminationLocal.firstWhereOrNull(
(it) =>
it.selectedExamination!.id ==
element.selectedExamination!.id,

@ -16,7 +16,7 @@ class SoapUtils {
static MySelectedAllergy generateMySelectedAllergy(
{allergy,
allergySeverity,
allergySeverity ,
isChecked = false,
remark,
isLocal = true,

@ -40,7 +40,7 @@ class AddAllergiesItem extends StatefulWidget {
}
class _AddAllergiesItemState extends State<AddAllergiesItem> {
late MasterKeyModel _selectedAllergySeverity;
MasterKeyModel ? _selectedAllergySeverity;
bool isSubmitted = false;
@override

@ -12,7 +12,7 @@ import 'package:provider/provider.dart';
import '../../shared_soap_widgets/SOAP_open_items.dart';
import 'add_allergies.dart';
import 'package:collection/collection.dart';
// ignore: must_be_immutable
class UpdateAllergiesWidget extends StatefulWidget {
List<MySelectedAllergy> myAllergiesList;
@ -163,7 +163,10 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
});
if (isAllDataFilled) {
mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere(
if ((widget.myAllergiesList.firstWhereOrNull (
(it) =>
it.selectedAllergy!.id ==
element.selectedAllergy!.id,)) ==
@ -175,7 +178,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
/// remove items.
List<MySelectedAllergy> removedList = [];
widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere(
if ((mySelectedAllergy.firstWhereOrNull(
(it) =>
it.selectedAllergy!.id ==
element.selectedAllergy!.id)) ==

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save