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,84 +208,45 @@ 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>[
SizedBox(
height: 10.0,
), ),
Container( )
child: model.patientList.isNotEmpty : ListView.builder(
? Column( scrollDirection: Axis.vertical,
// mainAxisAlignment: MainAxisAlignment.center, shrinkWrap: true,
children: model.filterData itemCount: model.filterData.length,
.map((PatiantInformtion itemBuilder: (BuildContext ctxt, int index) {
item) { return Padding(
return PatientCard( padding: EdgeInsets.all(8.0),
patientInfo: item, child: PatientCard(
patientType: patientInfo: model.filterData[index],
patientType, patientType: patientType,
arrivalType: arrivalType: arrivalType,
arrivalType, isInpatient: widget.isInpatient,
isInpatient:
widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed(
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": item, "patient": model.filterData[index],
"patientType": "patientType": "1",
"1", "from": widget
"from": widget.patientSearchRequestModel.from, .patientSearchRequestModel.from,
"to": widget.patientSearchRequestModel.from, "to": widget
"isSearch": .patientSearchRequestModel.from,
widget.isSearch, "isSearch": widget.isSearch,
"isInpatient": "isInpatient": widget.isInpatient,
widget.isInpatient, "arrivalType": "7",
"arrivalType":
"7",
}); });
}, },
isFromSearch: widget.isSearch, 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