|
|
|
|
@ -51,8 +51,8 @@ class _AddReplayOnReferralPatientState
|
|
|
|
|
void initState() {
|
|
|
|
|
requestPermissions();
|
|
|
|
|
super.initState();
|
|
|
|
|
replayOnReferralController.text = widget.myReferralInPatientModel.referredDoctorRemarks?? "";
|
|
|
|
|
|
|
|
|
|
replayOnReferralController.text =
|
|
|
|
|
widget.myReferralInPatientModel.referredDoctorRemarks ?? "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -60,67 +60,70 @@ class _AddReplayOnReferralPatientState
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
BottomSheetTitle(title: 'Reply'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: 'Reply your responses here',
|
|
|
|
|
controller: replayOnReferralController,
|
|
|
|
|
maxLines: 35,
|
|
|
|
|
minLines: 25,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError:
|
|
|
|
|
replayOnReferralController.text.isEmpty &&
|
|
|
|
|
isSubmitted
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 0, //MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: 15,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
size: 35,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onVoiceText();
|
|
|
|
|
},
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
BottomSheetTitle(title: 'Reply'),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: 'Reply your responses here',
|
|
|
|
|
controller: replayOnReferralController,
|
|
|
|
|
maxLines: 35,
|
|
|
|
|
minLines: 25,
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
validationError: replayOnReferralController
|
|
|
|
|
.text.isEmpty &&
|
|
|
|
|
isSubmitted
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 0,
|
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: 15,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
size: 35,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onVoiceText();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
replayOnReferralController.text.isEmpty
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: Expanded(
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
|
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
replayOnReferralController.text.isEmpty
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).clearText,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -128,55 +131,54 @@ class _AddReplayOnReferralPatientState
|
|
|
|
|
replayOnReferralController.text = '';
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: 'Submit Reply',
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = true;
|
|
|
|
|
});
|
|
|
|
|
if (replayOnReferralController.text.isNotEmpty) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await widget.patientReferralViewModel.replay(
|
|
|
|
|
replayOnReferralController.text.trim(),
|
|
|
|
|
widget.myReferralInPatientModel);
|
|
|
|
|
if (widget.patientReferralViewModel.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(
|
|
|
|
|
widget.patientReferralViewModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
"Your Reply Added Successfully");
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: ReplySummeryOnReferralPatient(
|
|
|
|
|
widget.myReferralInPatientModel,
|
|
|
|
|
replayOnReferralController.text.trim()),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: 'Submit Reply',
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = true;
|
|
|
|
|
});
|
|
|
|
|
if (replayOnReferralController.text.isNotEmpty) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await widget.patientReferralViewModel.replay(
|
|
|
|
|
replayOnReferralController.text.trim(),
|
|
|
|
|
widget.myReferralInPatientModel);
|
|
|
|
|
if (widget.patientReferralViewModel.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(
|
|
|
|
|
widget.patientReferralViewModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
Helpers.showErrorToast("You can't add empty reply");
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = false;
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
"Your Reply Added Successfully");
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: ReplySummeryOnReferralPatient(
|
|
|
|
|
widget.myReferralInPatientModel,
|
|
|
|
|
replayOnReferralController.text.trim()),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
})),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
} else {
|
|
|
|
|
Helpers.showErrorToast("You can't add empty reply");
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|