small fixes

merge-requests/960/head
Elham Rababh 4 years ago
parent bbdc243f0f
commit 45f30a8d61

@ -230,12 +230,12 @@ class PatientReferralViewModel extends BaseViewModel {
Future makeReferral(PatiantInformtion patient, String isoStringDate,
int projectID, int clinicID, int doctorID, String remarks) async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
await _referralPatientService.makeReferral(
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}

@ -207,10 +207,11 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
label: TranslationBase.of(context).fileNumber,
value: widget.reply.patientID.toString(),
isCopyable: false,
isExpanded: false,
),
CustomRow(
label: TranslationBase.of(context).age + " : ",
isCopyable: false,
label: TranslationBase.of(context).age + " : ", isCopyable: false,
isExpanded: false,
value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}",
),

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/helpers.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/profile/app_bar/patient-profile-app-bar.dart';
@ -209,19 +210,28 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
model
GifLoaderDialogUtils.showMyDialog(context);
await model
.makeReferral(
patient,
appointmentDate.toIso8601String(),
_selectedBranch['facilityId'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) {
_remarksController.text);
if(model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
}
},
),
)

@ -12,6 +12,7 @@ class CustomRow extends StatelessWidget {
this.valueSize,
this.width,
this.isCopyable = true,
this.isExpanded = true,
}) : super(key: key);
final String label;
@ -20,6 +21,7 @@ class CustomRow extends StatelessWidget {
final double valueSize;
final double width;
final bool isCopyable;
final bool isExpanded;
@override
Widget build(BuildContext context) {
@ -38,7 +40,7 @@ class CustomRow extends StatelessWidget {
width: 1,
),
Expanded(
flex: 0,
flex: isExpanded ? 1 : 0,
child: AppText(
value,
fontSize:

Loading…
Cancel
Save