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,13 +101,14 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
// const SizedBox( // const SizedBox(
// height: 16, // height: 16,
// ), // ),
...model.filteredInPatientItems.map((item) { ...List.generate(model.filteredInPatientItems.length, (index) {
if(_activeTab == 0)
return PatientCard( return PatientCard(
patientInfo: item, patientInfo: model.filteredInPatientItems[index],
patientType: "1", patientType: "1",
arrivalType: "1", arrivalType: "1",
isInpatient: true, isInpatient: true,
isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () { onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context); FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
@ -116,7 +117,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
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",
@ -126,7 +127,34 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
}); });
}, },
); );
}).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();
} }
if (_activeTab==0) {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getInPatientList(requestModel, await model.getInPatientList(requestModel,
isMyInpatient: _activeTab == 1, isFirstTime: false); isMyInpatient: _activeTab == 1, isFirstTime: false);
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
context); 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