|
|
|
|
@ -5,6 +5,7 @@ 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';
|
|
|
|
|
@ -28,6 +29,9 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
TextEditingController _searchController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
bool isSortDes = false;
|
|
|
|
|
bool isAllClinic = true;
|
|
|
|
|
bool showBottomSheet = false;
|
|
|
|
|
String selectedClinicName;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
@ -43,8 +47,73 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.070,
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14.0, vertical: 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;
|
|
|
|
|
showBottomSheet = true;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: 2,
|
|
|
|
|
groupValue: isAllClinic ? 1 : 2,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = false;
|
|
|
|
|
showBottomSheet = true;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
activeColor: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
AppText(selectedClinicName ?? "Select Clinic", fontSize: 15,),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(bottom: 10),
|
|
|
|
|
child: Icon(FontAwesomeIcons.sortDown))
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
@ -103,7 +172,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
itemCount: widget.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
// physics: ScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
if (!widget.isMyInPatient)
|
|
|
|
|
@ -116,16 +185,14 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
isInpatient: true,
|
|
|
|
|
isMyPatient: widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[
|
|
|
|
|
index]
|
|
|
|
|
.filteredInPatientItems[index]
|
|
|
|
|
.doctorId ==
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.doctorProfile.doctorID,
|
|
|
|
|
onTap: () {
|
|
|
|
|
FocusScopeNode currentFocus =
|
|
|
|
|
FocusScope.of(context);
|
|
|
|
|
if (!currentFocus
|
|
|
|
|
.hasPrimaryFocus) {
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -133,8 +200,9 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
PATIENTS_PROFILE,
|
|
|
|
|
arguments: {
|
|
|
|
|
"patient": widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[index],
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[
|
|
|
|
|
index],
|
|
|
|
|
"patientType": "1",
|
|
|
|
|
"from": "0",
|
|
|
|
|
"to": "0",
|
|
|
|
|
@ -155,8 +223,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
);
|
|
|
|
|
else if (widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[
|
|
|
|
|
index]
|
|
|
|
|
.filteredInPatientItems[index]
|
|
|
|
|
.doctorId ==
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.doctorProfile.doctorID &&
|
|
|
|
|
@ -170,16 +237,14 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
isInpatient: true,
|
|
|
|
|
isMyPatient: widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[
|
|
|
|
|
index]
|
|
|
|
|
.filteredInPatientItems[index]
|
|
|
|
|
.doctorId ==
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.doctorProfile.doctorID,
|
|
|
|
|
onTap: () {
|
|
|
|
|
FocusScopeNode currentFocus =
|
|
|
|
|
FocusScope.of(context);
|
|
|
|
|
if (!currentFocus
|
|
|
|
|
.hasPrimaryFocus) {
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -187,8 +252,9 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
PATIENTS_PROFILE,
|
|
|
|
|
arguments: {
|
|
|
|
|
"patient": widget
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[index],
|
|
|
|
|
.patientSearchViewModel
|
|
|
|
|
.filteredInPatientItems[
|
|
|
|
|
index],
|
|
|
|
|
"patientType": "1",
|
|
|
|
|
"from": "0",
|
|
|
|
|
"to": "0",
|
|
|
|
|
@ -210,9 +276,13 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
else
|
|
|
|
|
return SizedBox();
|
|
|
|
|
}),
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 ) {
|
|
|
|
|
widget.patientSearchViewModel.addOnFilteredList();
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (isAllClinic) if (t
|
|
|
|
|
is ScrollUpdateNotification &&
|
|
|
|
|
t.metrics.pixels >=
|
|
|
|
|
t.metrics.maxScrollExtent - 50) {
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.addOnFilteredList();
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
@ -228,6 +298,56 @@ class _InPatientListPageState extends State<InPatientListPage> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: !showBottomSheet
|
|
|
|
|
? Container(
|
|
|
|
|
height: 0,
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
height: 500,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount: widget
|
|
|
|
|
.patientSearchViewModel.myInpatientClinicList.length,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = false;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
selectedClinicName = widget.patientSearchViewModel
|
|
|
|
|
.myInpatientClinicList[index];
|
|
|
|
|
});
|
|
|
|
|
widget.patientSearchViewModel.filterByClinic(
|
|
|
|
|
clinicName: widget.patientSearchViewModel
|
|
|
|
|
.myInpatientClinicList[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Radio(
|
|
|
|
|
value: widget.patientSearchViewModel
|
|
|
|
|
.myInpatientClinicList[index],
|
|
|
|
|
groupValue: selectedClinicName,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAllClinic = false;
|
|
|
|
|
showBottomSheet = false;
|
|
|
|
|
});
|
|
|
|
|
widget.patientSearchViewModel
|
|
|
|
|
.filterByClinic(clinicName: value);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
activeColor: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
AppText(widget.patientSearchViewModel
|
|
|
|
|
.myInpatientClinicList[index]),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|