Fixing some design issues in refer-patient-screen-in-patient and refer-patient-screen

merge-requests/976/head
RoaaGhali98 4 years ago
parent c4f2543471
commit 01cd91ef93

@ -6,9 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -158,24 +160,14 @@ class _PatientMakeInPatientReferralScreenState
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( SizedBox(
margin: EdgeInsets.all(16.0), height: 10,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refer}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
), ),
AppText( Padding(
"${TranslationBase.of(context).patient}", padding: const EdgeInsets.all(8.0),
fontFamily: 'Poppins', child: ServiceTitle(
fontSize: SizeConfig.textMultiplier * 3, title: TranslationBase.of(context).refer,
fontWeight: FontWeight.bold, subTitle: TranslationBase.of(context).patient,
)
],
), ),
), ),
Container( Container(
@ -398,24 +390,33 @@ class _PatientMakeInPatientReferralScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText( Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).priority}", "${TranslationBase.of(context).priority}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
priorityBar(context, screenSize), Padding(
padding: const EdgeInsets.all(3.0),
child: priorityBar(context, screenSize),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText( Padding(
padding: const EdgeInsets.all(4.0),
child: AppText(
"${TranslationBase.of(context).replayBefore}: ${getPriority()}", "${TranslationBase.of(context).replayBefore}: ${getPriority()}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.9, fontSize: SizeConfig.textMultiplier * 1.9,
), ),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -475,7 +476,6 @@ class _PatientMakeInPatientReferralScreenState
), ),
Positioned( Positioned(
top: 0, top: 0,
//MediaQuery.of(context).size.height * 0,
right: 15, right: 15,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
@ -510,13 +510,12 @@ class _PatientMakeInPatientReferralScreenState
}); });
}, },
)), )),
Container( SizedBox(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), height: 10,
child: AppButton( ),
title: TranslationBase.of(context).refer, BottomSheetDialogButton(
fontWeight: FontWeight.w700, label: "${TranslationBase.of(context).refer}",
color: AppGlobal.appGreenColor, onTap: () async {
onPressed: () async {
setState(() { setState(() {
if (_referTo == null) { if (_referTo == null) {
branchError = branchError =
@ -578,7 +577,6 @@ class _PatientMakeInPatientReferralScreenState
} }
}, },
), ),
)
], ],
) )
], ],
@ -597,6 +595,7 @@ class _PatientMakeInPatientReferralScreenState
]; ];
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
width: screenSize.width * 0.95,
decoration: decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row( child: Row(

@ -5,11 +5,13 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -86,26 +88,11 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
/*PatientProfileHeaderNewDesign( Padding(
patient, patientType, arrivalType),*/ padding: const EdgeInsets.all(8.0),
Container( child: ServiceTitle(
margin: EdgeInsets.all(16.0), title: TranslationBase.of(context).refer,
child: Column( subTitle: TranslationBase.of(context).patient,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refer}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.6,
fontWeight: FontWeight.w600,
),
AppText(
"${TranslationBase.of(context).patient}",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.bold,
)
],
), ),
), ),
model.patientReferral.length == 0 model.patientReferral.length == 0
@ -166,16 +153,15 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
.referredByDoctorInfo, .referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
), ),
SizedBox(
height: 10,
),
], ],
), ),
if (model.patientReferral.length == 0) if (model.patientReferral.length == 0)
Container( BottomSheetDialogButton(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), label: "${TranslationBase.of(context).refer}",
child: AppButton( onTap: () async {
title: TranslationBase.of(context).refer,
fontWeight: FontWeight.w700,
color: HexColor("#359846"),
onPressed: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Refer Patient", eventCategory: "Refer Patient",
eventAction: "Submit Refer", eventAction: "Submit Refer",
@ -204,37 +190,82 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
} else { } else {
doctorError = null; doctorError = null;
} }
if (appointmentDate == null || if (appointmentDate == null ||
_selectedBranch == null || _selectedBranch == null ||
_selectedClinic == null || _selectedClinic == null ||
_selectedDoctor == null || _selectedDoctor == null ||
_remarksController.text == null) return; _remarksController.text == null) return;
GifLoaderDialogUtils.showMyDialog(context); model
await model
.makeReferral( .makeReferral(
patient, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['facilityId'], _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text); _remarksController.text)
if(model.state == ViewState.ErrorLocal) { .then((_) {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg); TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context); Navigator.pop(context);
}
}, });
}
), ),
) // child: AppButton(
// title: TranslationBase.of(context).refer,
// fontWeight: FontWeight.w700,
// color: HexColor("#359846"),
// onPressed: () async {
// await locator<AnalyticsService>().logEvent(
// eventCategory: "Refer Patient",
// eventAction: "Submit Refer",
// );
// if (_referTo == null) {
// branchError =
// TranslationBase.of(context).fieldRequired;
// } else {
// branchError = null;
// }
// if (_selectedBranch == null) {
// hospitalError =
// TranslationBase.of(context).fieldRequired;
// } else {
// hospitalError = null;
// }
// if (_selectedClinic == null) {
// clinicError =
// TranslationBase.of(context).fieldRequired;
// } else {
// clinicError = null;
// }
// if (_selectedDoctor == null) {
// doctorError =
// TranslationBase.of(context).fieldRequired;
// } else {
// doctorError = null;
// }
//
// if (appointmentDate == null ||
// _selectedBranch == null ||
// _selectedClinic == null ||
// _selectedDoctor == null ||
// _remarksController.text == null) return;
// model
// .makeReferral(
// patient,
// appointmentDate.toIso8601String(),
// _selectedBranch['facilityId'],
// _selectedClinic['ClinicID'],
// _selectedDoctor['DoctorID'],
// _remarksController.text)
// .then((_) {
// DrAppToastMsg.showSuccesToast(
// TranslationBase.of(context).referralSuccessMsg);
// Navigator.pop(context);
// });
// },
// ),
], ],
), ),
), ),

Loading…
Cancel
Save