hot fixes

merge-requests/607/head
Mohammad Aljammal 5 years ago
parent 60eb7adab1
commit 21fd90ea8c

@ -152,7 +152,7 @@ class PatientSearchViewModel extends BaseViewModel{
setState(ViewState.Busy); setState(ViewState.Busy);
else else
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _inPatientService.getInPatientList(requestModel, isMyInpatient); await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -101,32 +101,60 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
// const SizedBox( // const SizedBox(
// height: 16, // height: 16,
// ), // ),
...model.filteredInPatientItems.map((item) { ...List.generate(model.filteredInPatientItems.length, (index) {
return PatientCard( if(_activeTab == 0)
patientInfo: item, return PatientCard(
patientType: "1", patientInfo: model.filteredInPatientItems[index],
arrivalType: "1", patientType: "1",
isInpatient: true, arrivalType: "1",
isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, isInpatient: true,
onTap: () { isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
FocusScopeNode currentFocus = FocusScope.of(context); onTap: () {
if (!currentFocus.hasPrimaryFocus) { FocusScopeNode currentFocus = FocusScope.of(context);
currentFocus.unfocus(); if (!currentFocus.hasPrimaryFocus) {
} currentFocus.unfocus();
}
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: { .pushNamed(PATIENTS_PROFILE, arguments: {
"patient": item, "patient": model.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
}); });
}, },
); );
}).toList(), else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1)
return PatientCard(
patientInfo: model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else return SizedBox();
}),
SizedBox(height: 15,)
], ],
), ),
), ),
@ -173,12 +201,14 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
GifLoaderDialogUtils.showMyDialog( if (_activeTab==0) {
context); GifLoaderDialogUtils.showMyDialog(
await model.getInPatientList(requestModel, context);
isMyInpatient: _activeTab == 1, isFirstTime: false); await model.getInPatientList(requestModel,
GifLoaderDialogUtils.hideDialog( isMyInpatient: _activeTab == 1, isFirstTime: false);
context); GifLoaderDialogUtils.hideDialog(
context);
}
}, },
child: Center( child: Center(
child: Container( child: Container(

@ -92,7 +92,8 @@ class DrAppSharedPreferances {
clear() async { clear() async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
prefs.clear(); var vvas= await prefs.clear();
var asd;
} }
remove(String key) async { remove(String key) async {

Loading…
Cancel
Save