Merge branch 'episode_inpatient_changes' into 'development'
Episode inpatient changes See merge request Cloud_Solution/doctor_app_flutter!829merge-requests/831/merge
commit
ca3dddd581
@ -0,0 +1,20 @@
|
|||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class NoData extends StatelessWidget {
|
||||||
|
const NoData({
|
||||||
|
Key key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
child: ErrorMessage(
|
||||||
|
error: TranslationBase.of(context).noDataAvailable)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../routes.dart';
|
||||||
|
import 'NoData.dart';
|
||||||
|
|
||||||
|
class ListOfAllInPatient extends StatelessWidget {
|
||||||
|
const ListOfAllInPatient({
|
||||||
|
Key key,
|
||||||
|
@required this.isAllClinic,
|
||||||
|
@required this.hasQuery,
|
||||||
|
this.patientSearchViewModel,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final bool isAllClinic;
|
||||||
|
final bool hasQuery;
|
||||||
|
|
||||||
|
|
||||||
|
final PatientSearchViewModel patientSearchViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: patientSearchViewModel.filteredInPatientItems.length == 0
|
||||||
|
? NoData()
|
||||||
|
: NotificationListener(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount:
|
||||||
|
patientSearchViewModel.filteredInPatientItems.length,
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return PatientCard(
|
||||||
|
patientInfo: patientSearchViewModel
|
||||||
|
.filteredInPatientItems[index],
|
||||||
|
patientType: "1",
|
||||||
|
arrivalType: "1",
|
||||||
|
isInpatient: true,
|
||||||
|
isMyPatient: patientSearchViewModel
|
||||||
|
.filteredInPatientItems[index].doctorId ==
|
||||||
|
patientSearchViewModel.doctorProfile.doctorID,
|
||||||
|
onTap: () {
|
||||||
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||||
|
if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
currentFocus.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamed(PATIENTS_PROFILE, arguments: {
|
||||||
|
"patient": patientSearchViewModel
|
||||||
|
.filteredInPatientItems[index],
|
||||||
|
"patientType": "1",
|
||||||
|
"from": "0",
|
||||||
|
"to": "0",
|
||||||
|
"isSearch": false,
|
||||||
|
"isInpatient": true,
|
||||||
|
"arrivalType": "1",
|
||||||
|
"isMyPatient": patientSearchViewModel
|
||||||
|
.filteredInPatientItems[index].doctorId ==
|
||||||
|
patientSearchViewModel.doctorProfile.doctorID,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// else if (widget.patientSearchViewModel
|
||||||
|
// .filteredInPatientItems[index].doctorId ==
|
||||||
|
// widget.patientSearchViewModel.doctorProfile.doctorID &&
|
||||||
|
// widget.isMyInPatient)
|
||||||
|
// return PatientCard(
|
||||||
|
// patientInfo: widget
|
||||||
|
// .patientSearchViewModel.filteredInPatientItems[index],
|
||||||
|
// patientType: "1",
|
||||||
|
// arrivalType: "1",
|
||||||
|
// isInpatient: true,
|
||||||
|
// isMyPatient: widget.patientSearchViewModel
|
||||||
|
// .filteredInPatientItems[index].doctorId ==
|
||||||
|
// widget.patientSearchViewModel.doctorProfile.doctorID,
|
||||||
|
// onTap: () {
|
||||||
|
// FocusScopeNode currentFocus = FocusScope.of(context);
|
||||||
|
// if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
// currentFocus.unfocus();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Navigator.of(context)
|
||||||
|
// .pushNamed(PATIENTS_PROFILE, arguments: {
|
||||||
|
// "patient": widget.patientSearchViewModel
|
||||||
|
// .filteredInPatientItems[index],
|
||||||
|
// "patientType": "1",
|
||||||
|
// "from": "0",
|
||||||
|
// "to": "0",
|
||||||
|
// "isSearch": false,
|
||||||
|
// "isInpatient": true,
|
||||||
|
// "arrivalType": "1",
|
||||||
|
// "isMyPatient": widget.patientSearchViewModel
|
||||||
|
// .filteredInPatientItems[index].doctorId ==
|
||||||
|
// widget
|
||||||
|
// .patientSearchViewModel.doctorProfile.doctorID,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// else
|
||||||
|
// return SizedBox();
|
||||||
|
}),
|
||||||
|
onNotification: (notification) {
|
||||||
|
if (isAllClinic && !hasQuery) if (notification
|
||||||
|
is ScrollUpdateNotification) {
|
||||||
|
if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) {
|
||||||
|
patientSearchViewModel.addOnFilteredList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) {
|
||||||
|
patientSearchViewModel.removeOnFilteredList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../routes.dart';
|
||||||
|
import 'NoData.dart';
|
||||||
|
class ListOfMyInpatient extends StatelessWidget {
|
||||||
|
const ListOfMyInpatient({
|
||||||
|
Key key,
|
||||||
|
@required this.isAllClinic,
|
||||||
|
@required this.hasQuery,
|
||||||
|
this.patientSearchViewModel,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final bool isAllClinic;
|
||||||
|
final bool hasQuery;
|
||||||
|
final PatientSearchViewModel patientSearchViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child:Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: patientSearchViewModel.filteredMyInPatientItems.length == 0
|
||||||
|
? NoData():NotificationListener(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: patientSearchViewModel.filteredMyInPatientItems.length,
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
// physics: ScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return PatientCard(
|
||||||
|
patientInfo: patientSearchViewModel.filteredMyInPatientItems[index],
|
||||||
|
patientType: "1",
|
||||||
|
arrivalType: "1",
|
||||||
|
isInpatient: true,
|
||||||
|
isMyPatient: true,
|
||||||
|
onTap: () {
|
||||||
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||||
|
if (!currentFocus.hasPrimaryFocus) {
|
||||||
|
currentFocus.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(context)
|
||||||
|
.pushNamed(PATIENTS_PROFILE, arguments: {
|
||||||
|
"patient":
|
||||||
|
patientSearchViewModel.filteredInPatientItems[index],
|
||||||
|
"patientType": "1",
|
||||||
|
"from": "0",
|
||||||
|
"to": "0",
|
||||||
|
"isSearch": false,
|
||||||
|
"isInpatient": true,
|
||||||
|
"arrivalType": "1",
|
||||||
|
"isMyPatient": true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
onNotification: (t) {
|
||||||
|
if (isAllClinic && !hasQuery) if (t is ScrollUpdateNotification) {
|
||||||
|
//TODO Elham*
|
||||||
|
// if (t.metrics.pixels >= t.metrics.maxScrollExtent - 50) {
|
||||||
|
// patientSearchViewModel.addOnFilteredList();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (t.metrics.pixels <= t.metrics.minScrollExtent - 50) {
|
||||||
|
// patientSearchViewModel.removeOnFilteredList();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue