fix issue in patients_screen

merge-requests/606/head
Elham Rababah 5 years ago
parent 05a3ca7300
commit 4c493d8ea6

@ -124,6 +124,7 @@ class PatientSearchViewModel extends BaseViewModel{
currentModel.firstName = patientSearchRequestModel.firstName; currentModel.firstName = patientSearchRequestModel.firstName;
currentModel.lastName = patientSearchRequestModel.lastName; currentModel.lastName = patientSearchRequestModel.lastName;
currentModel.middleName = patientSearchRequestModel.middleName; currentModel.middleName = patientSearchRequestModel.middleName;
currentModel.doctorID = patientSearchRequestModel.doctorID;
currentModel.from = dateFrom; currentModel.from = dateFrom;
currentModel.to = dateTo; currentModel.to = dateTo;

@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
@ -208,85 +208,46 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
), ),
Expanded( Expanded(
child: Container( child: Container(
// color: Colors.grey[200], child: model.filterData.isEmpty
child: ListView( ? Center(
scrollDirection: Axis.vertical, child: ErrorMessage(
children: <Widget>[ error: TranslationBase.of(context)
Container( .youDontHaveAnyPatient,
child: Column( ),
children: <Widget>[ )
: ListView.builder(
SizedBox( scrollDirection: Axis.vertical,
height: 10.0, shrinkWrap: true,
), itemCount: model.filterData.length,
Container( itemBuilder: (BuildContext ctxt, int index) {
child: model.patientList.isNotEmpty return Padding(
? Column( padding: EdgeInsets.all(8.0),
// mainAxisAlignment: MainAxisAlignment.center, child: PatientCard(
children: model.filterData patientInfo: model.filterData[index],
.map((PatiantInformtion patientType: patientType,
item) { arrivalType: arrivalType,
return PatientCard( isInpatient: widget.isInpatient,
patientInfo: item, onTap: () {
patientType: // TODO change the parameter to daynamic
patientType, Navigator.of(context).pushNamed(
arrivalType: PATIENTS_PROFILE,
arrivalType, arguments: {
isInpatient: "patient": model.filterData[index],
widget.isInpatient, "patientType": "1",
onTap: () { "from": widget
// TODO change the parameter to daynamic .patientSearchRequestModel.from,
Navigator.of(context) "to": widget
.pushNamed( .patientSearchRequestModel.from,
PATIENTS_PROFILE, "isSearch": widget.isSearch,
arguments: { "isInpatient": widget.isInpatient,
"patient": item, "arrivalType": "7",
"patientType": });
"1", },
"from": widget.patientSearchRequestModel.from, isFromSearch: widget.isSearch,
"to": widget.patientSearchRequestModel.from,
"isSearch":
widget.isSearch,
"isInpatient":
widget.isInpatient,
"arrivalType":
"7",
});
},
isFromSearch: widget.isSearch,
);
}).toList(),
)
: Center(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.center,
children: [
SizedBox(
height: 100,
),
Image.asset(
'assets/images/no-data.png'),
Padding(
padding:
const EdgeInsets
.all(8.0),
child: AppText(
TranslationBase.of(
context)
.youDontHaveAnyPatient),
)
],
), ),
)), );
], })),
),
)
],
),
), ),
),
], ],
) )
), ),

Loading…
Cancel
Save