separate in patient and my in patient to 2 files

merge-requests/829/head
Elham Rababh 4 years ago
parent 37cd34f568
commit ce199f7d98

@ -30,9 +30,9 @@ class PatientSearchViewModel extends BaseViewModel {
int firstSubsetIndex = 0;
int inPatientPageSize = 20;
int lastSubsetIndex = 19;
int lastSubsetIndex = 20;
List<String> myInpatientClinicList = [];
List<String> InpatientClinicList = [];
searchData(String str) {
var strExist = str.length > 0 ? true : false;
@ -88,10 +88,8 @@ class PatientSearchViewModel extends BaseViewModel {
sortOutPatient({bool isDes = false}) {
if (isDes)
filterData = filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm));
else
filterData = filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>a.appointmentDateWithDateTimeForm.compareTo(b.appointmentDateWithDateTimeForm));
setState(ViewState.Idle);
}
@ -166,6 +164,7 @@ class PatientSearchViewModel extends BaseViewModel {
_inPatientService.myInPatientList;
List<PatiantInformtion> filteredInPatientItems = List();
List<PatiantInformtion> filteredMyInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isLocalBusy = false}) async {
@ -186,17 +185,22 @@ class PatientSearchViewModel extends BaseViewModel {
}
} else {
setDefaultInPatientList();
generateMyInpatientClinicList();
generateInpatientClinicList();
setState(ViewState.Idle);
}
}
sortInPatient({bool isDes = false, bool isAllClinic}) {
if (isAllClinic
? inPatientList.length > 0
: filteredInPatientItems.length > 0) {
List<PatiantInformtion> localInPatient =
isAllClinic ? [...inPatientList] : [...filteredInPatientItems];
sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) {
if (isMyInPatient
? myIinPatientList.length > 0
: isAllClinic
? inPatientList.length > 0
: filteredInPatientItems.length > 0) {
List<PatiantInformtion> localInPatient = isMyInPatient
? [...filteredMyInPatientItems]
: isAllClinic
? [...inPatientList]
: [...filteredInPatientItems];
if (isDes)
localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => b
.admissionDateWithDateTimeForm
@ -205,8 +209,10 @@ class PatientSearchViewModel extends BaseViewModel {
localInPatient.sort((PatiantInformtion a, PatiantInformtion b) => a
.admissionDateWithDateTimeForm
.compareTo(b.admissionDateWithDateTimeForm));
if (isAllClinic) {
if (isMyInPatient) {
filteredMyInPatientItems.clear();
filteredMyInPatientItems.addAll(localInPatient);
} else if (isAllClinic) {
resetInPatientPagination();
filteredInPatientItems
.addAll(localInPatient.sublist(firstSubsetIndex, lastSubsetIndex));
@ -231,13 +237,17 @@ class PatientSearchViewModel extends BaseViewModel {
if (inPatientList.length > 0)
filteredInPatientItems
.addAll(inPatientList.sublist(firstSubsetIndex, lastSubsetIndex));
if (myIinPatientList.length > 0) {
filteredMyInPatientItems.addAll(myIinPatientList);
}
setState(ViewState.Idle);
}
generateMyInpatientClinicList() {
generateInpatientClinicList() {
inPatientList.forEach((element) {
if (!myInpatientClinicList.contains(element.clinicDescription)) {
myInpatientClinicList.add(element.clinicDescription);
if (!InpatientClinicList.contains(element.clinicDescription)) {
InpatientClinicList.add(element.clinicDescription);
}
});
}
@ -259,9 +269,8 @@ class PatientSearchViewModel extends BaseViewModel {
}
removeOnFilteredList() {
if (lastSubsetIndex-inPatientPageSize - 1 > 0) {
filteredInPatientItems
.removeAt(lastSubsetIndex-inPatientPageSize - 1);
if (lastSubsetIndex - inPatientPageSize - 1 > 0) {
filteredInPatientItems.removeAt(lastSubsetIndex - inPatientPageSize - 1);
setState(ViewState.Idle);
}
}
@ -291,61 +300,95 @@ class PatientSearchViewModel extends BaseViewModel {
_inPatientService.myInPatientList = [];
}
void filterSearchResults(String query, {bool isAllClinic}) {
void filterSearchResults(String query,
{bool isAllClinic, bool isMyInPatient}) {
var strExist = query.length > 0 ? true : false;
if (isAllClinic) {
if (strExist) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
String firstName = inPatientList[i].firstName.toUpperCase();
String lastName = inPatientList[i].lastName.toUpperCase();
String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(inPatientList[i]);
}
}
notifyListeners();
} else {
if (inPatientList.length > 0) filteredInPatientItems.clear();
filteredInPatientItems.addAll(inPatientList);
notifyListeners();
}
} else {
List<PatiantInformtion> localFilteredInPatientItems = [
...filteredInPatientItems
if (isMyInPatient) {
List<PatiantInformtion> localFilteredMyInPatientItems = [
...myIinPatientList
];
if (strExist) {
filteredInPatientItems.clear();
for (var i = 0; i < localFilteredInPatientItems.length; i++) {
filteredMyInPatientItems.clear();
for (var i = 0; i < localFilteredMyInPatientItems.length; i++) {
String firstName =
localFilteredInPatientItems[i].firstName.toUpperCase();
localFilteredMyInPatientItems[i].firstName.toUpperCase();
String lastName =
localFilteredInPatientItems[i].lastName.toUpperCase();
localFilteredMyInPatientItems[i].lastName.toUpperCase();
String mobile =
localFilteredInPatientItems[i].mobileNumber.toUpperCase();
localFilteredMyInPatientItems[i].mobileNumber.toUpperCase();
String patientID =
localFilteredInPatientItems[i].patientId.toString();
localFilteredMyInPatientItems[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(localFilteredInPatientItems[i]);
filteredMyInPatientItems.add(localFilteredMyInPatientItems[i]);
}
}
notifyListeners();
} else {
if (localFilteredInPatientItems.length > 0)
filteredInPatientItems.clear();
filteredInPatientItems.addAll(localFilteredInPatientItems);
if (myIinPatientList.length > 0) filteredMyInPatientItems.clear();
filteredMyInPatientItems.addAll(myIinPatientList);
notifyListeners();
}
} else {
if (isAllClinic) {
if (strExist) {
filteredInPatientItems = [];
for (var i = 0; i < inPatientList.length; i++) {
String firstName = inPatientList[i].firstName.toUpperCase();
String lastName = inPatientList[i].lastName.toUpperCase();
String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(inPatientList[i]);
}
}
notifyListeners();
} else {
if (inPatientList.length > 0) filteredInPatientItems.clear();
filteredInPatientItems.addAll(inPatientList);
notifyListeners();
}
} else {
List<PatiantInformtion> localFilteredInPatientItems = [
...filteredInPatientItems
];
if (strExist) {
filteredInPatientItems.clear();
for (var i = 0; i < localFilteredInPatientItems.length; i++) {
String firstName =
localFilteredInPatientItems[i].firstName.toUpperCase();
String lastName =
localFilteredInPatientItems[i].lastName.toUpperCase();
String mobile =
localFilteredInPatientItems[i].mobileNumber.toUpperCase();
String patientID =
localFilteredInPatientItems[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) ||
mobile.contains(query) ||
patientID.contains(query)) {
filteredInPatientItems.add(localFilteredInPatientItems[i]);
}
}
notifyListeners();
} else {
if (localFilteredInPatientItems.length > 0)
filteredInPatientItems.clear();
filteredInPatientItems.addAll(localFilteredInPatientItems);
notifyListeners();
}
}
}
}

@ -1,20 +1,16 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_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/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../../routes.dart';
import 'NoData.dart';
import 'list_of_all_in_patient.dart';
import 'list_of_my_inpatient.dart';
class InPatientListPage extends StatefulWidget {
final bool isMyInPatient;
@ -49,82 +45,88 @@ class _InPatientListPageState extends State<InPatientListPage> {
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(!widget.isMyInPatient)
Container(
margin: EdgeInsets.only(left: 10.0, right: 10, top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Row(
children: [
Radio(
value: 1,
groupValue: isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
setState(() {
isAllClinic = true;
showBottomSheet = false;
});
widget.patientSearchViewModel
.setDefaultInPatientList();
});
},
activeColor: Colors.red,
),
AppText(
"All Clinic",
fontSize: 15,
),
],
),
onTap: () {
setState(() {
isAllClinic = true;
showBottomSheet = false;
});
widget.patientSearchViewModel.setDefaultInPatientList();
},
),
InkWell(
onTap: () {
setState(() {
isAllClinic = false;
if(widget.patientSearchViewModel.myInpatientClinicList.length > 0)
showBottomSheet = true;
});
},
if (!widget.isMyInPatient)
Container(
margin: EdgeInsets.only(left: 10.0, right: 10, top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Row(
children: [
Radio(
value: 2,
value: 1,
groupValue: isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
setState(() {
isAllClinic = false;
if(widget.patientSearchViewModel.myInpatientClinicList.length > 0)
showBottomSheet = true;
isAllClinic = true;
showBottomSheet = false;
});
widget.patientSearchViewModel
.setDefaultInPatientList();
});
},
activeColor: Colors.red,
),
AppText(
selectedClinicName ?? "Select Clinic",
"All Clinic",
fontSize: 15,
),
Container(
margin: EdgeInsets.only(bottom: 10),
child: Icon(FontAwesomeIcons.sortDown))
],
)),
],
),
onTap: () {
setState(() {
isAllClinic = true;
showBottomSheet = false;
});
widget.patientSearchViewModel.setDefaultInPatientList();
},
),
InkWell(
onTap: () {
setState(() {
isAllClinic = false;
if (widget.patientSearchViewModel.InpatientClinicList
.length >
0) showBottomSheet = true;
});
},
child: Row(
children: [
Radio(
value: 2,
groupValue: isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
setState(() {
isAllClinic = false;
if (widget.patientSearchViewModel
.InpatientClinicList.length >
0) showBottomSheet = true;
});
});
},
activeColor: Colors.red,
),
AppText(
selectedClinicName ?? "Select Clinic",
fontSize: 15,
),
Container(
margin: EdgeInsets.only(bottom: 10),
child: Icon(FontAwesomeIcons.sortDown))
],
)),
],
),
),
),
Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 5),
margin: EdgeInsets.only(
left: 16,
right: 16,
bottom: 16,
top: widget.isMyInPatient ? 15 : 5),
child: Stack(
children: [
AppTextFieldCustom(
@ -143,7 +145,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
hasQuery = true;
});
widget.patientSearchViewModel
.filterSearchResults(value, isAllClinic: isAllClinic);
.filterSearchResults(value, isAllClinic: isAllClinic, isMyInPatient:widget.isMyInPatient);
}),
Positioned(
right: 35,
@ -160,7 +162,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(
isDes: isSortDes, isAllClinic: isAllClinic);
isDes: isSortDes, isAllClinic: isAllClinic, isMyInPatient:widget.isMyInPatient);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
@ -170,146 +172,26 @@ class _InPatientListPageState extends State<InPatientListPage> {
),
),
widget.patientSearchViewModel.state == ViewState.Idle
? widget.patientSearchViewModel.filteredInPatientItems.length > 0
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList
.length ==
0)
? NoData()
: Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: NotificationListener(
child: ListView.builder(
itemCount: widget.patientSearchViewModel
.filteredInPatientItems.length,
scrollDirection: Axis.vertical,
// physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
if (!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 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: (t) {
if (isAllClinic && !hasQuery) if (t
is ScrollUpdateNotification) {
if (t.metrics.pixels >=
t.metrics.maxScrollExtent - 50) {
widget.patientSearchViewModel
.addOnFilteredList();
}
if (t.metrics.pixels <=
t.metrics.minScrollExtent - 50) {
widget.patientSearchViewModel
.removeOnFilteredList();
}
}
return;
},
),
),
)
: NoData()
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList.length > 0)
? ListOfMyInpatient(
isAllClinic: isAllClinic,
hasQuery: hasQuery,
patientSearchViewModel: widget.patientSearchViewModel)
: widget.patientSearchViewModel.filteredInPatientItems
.length >
0
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList
.length ==
0)
? NoData()
: ListOfAllInPatient(
isAllClinic: isAllClinic,
hasQuery: hasQuery,
patientSearchViewModel:
widget.patientSearchViewModel)
: NoData()
: Center(
child: Container(
height: 300,
@ -326,8 +208,8 @@ class _InPatientListPageState extends State<InPatientListPage> {
height: MediaQuery.of(context).size.height * 0.5,
color: Colors.white,
child: ListView.builder(
itemCount: widget
.patientSearchViewModel.myInpatientClinicList.length,
itemCount:
widget.patientSearchViewModel.InpatientClinicList.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
@ -338,17 +220,17 @@ class _InPatientListPageState extends State<InPatientListPage> {
isAllClinic = false;
showBottomSheet = false;
selectedClinicName = widget.patientSearchViewModel
.myInpatientClinicList[index];
.InpatientClinicList[index];
});
widget.patientSearchViewModel.filterByClinic(
clinicName: widget.patientSearchViewModel
.myInpatientClinicList[index]);
.InpatientClinicList[index]);
},
child: Row(
children: [
Radio(
value: widget.patientSearchViewModel
.myInpatientClinicList[index],
.InpatientClinicList[index],
groupValue: selectedClinicName,
onChanged: (value) {
setState(() {
@ -363,7 +245,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
activeColor: Colors.red,
),
AppText(widget.patientSearchViewModel
.myInpatientClinicList[index]),
.InpatientClinicList[index]),
],
));
}),
@ -373,3 +255,4 @@ class _InPatientListPageState extends State<InPatientListPage> {
}

@ -0,0 +1,124 @@
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,
// physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
// if (!isMyInPatient)
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: (t) {
if (isAllClinic && !hasQuery) if (t
is ScrollUpdateNotification) {
if (t.metrics.pixels >= t.metrics.maxScrollExtent - 50) {
patientSearchViewModel.addOnFilteredList();
}
if (t.metrics.pixels <= t.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…
Cancel
Save