Merge branch 'Stepper_header' into 'development'

add doctor replay

See merge request Cloud_Solution/doctor_app_flutter!502
merge-requests/503/merge
Mohammad Aljammal 5 years ago
commit d450affa37

@ -33,13 +33,13 @@ class DoctorReplyService extends BaseService {
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async {
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo;
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString();
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
@ -49,9 +49,10 @@ class DoctorReplyService extends BaseService {
ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
model.referredDoctorRemarks = referredDoctorRemarks;
listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] =
model;
print("succsss");
// model.referredDoctorRemarks = referredDoctorRemarks;
// listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] =
// model;
},
onFailure: (String error, int statusCode) {
hasError = true;

@ -21,7 +21,7 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async {
Future replay(String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
setState(ViewState.BusyLocal);
await _doctorReplyService.replay(referredDoctorRemarks, model);
if (_doctorReplyService.hasError) {

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart';
class ListGtMyPatientsQuestions {
String setupID;
int projectID;
@ -24,9 +26,9 @@ class ListGtMyPatientsQuestions {
String dateofBirth;
String mobileNumber;
String emailAddress;
String doctorResponse;
String infoStatus;
Null clinicID;
int admissionNo;
int referringDoctor;
int lineItemNo;
String age;
String genderDescription;
bool isVidaCall;
@ -53,9 +55,9 @@ class ListGtMyPatientsQuestions {
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.doctorResponse,
this.infoStatus,
this.clinicID,
this.admissionNo,
this.referringDoctor,
this.lineItemNo,
this.age,
this.genderDescription,
this.isVidaCall});
@ -69,7 +71,6 @@ class ListGtMyPatientsQuestions {
doctorID = json['DoctorID'];
requestType = json['RequestType'];
requestDate = Helpers.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime'];
remarks = json['Remarks'];
status = json['Status'];
@ -83,9 +84,9 @@ class ListGtMyPatientsQuestions {
dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress'];
doctorResponse = json['DoctorResponse'];
infoStatus = json['InfoStatus'];
clinicID = json['ClinicID'];
admissionNo = json['AdmissionNo'];
referringDoctor = json['ReferringDoctor'];
lineItemNo = json['LineItemNo'];
age = json['Age'];
genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall'];
@ -114,12 +115,13 @@ class ListGtMyPatientsQuestions {
data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress;
data['DoctorResponse'] = this.doctorResponse;
data['InfoStatus'] = this.infoStatus;
data['ClinicID'] = this.clinicID;
data['AdmissionNo'] = this.admissionNo;
data['ReferringDoctor'] = this.referringDoctor;
data['LineItemNo'] = this.lineItemNo;
data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall;
return data;
}
}

@ -1,9 +1,15 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
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/screens/doctor/doctor_reply_screen.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -30,6 +36,7 @@ class DoctorReplayChat extends StatelessWidget {
baseViewModel: model,
isShowAppBar: false,
body: Container(
height: MediaQuery.of(context).size.height * 1,
color: Color(0XFFF2F2F2),
child: Stack(
children: [
@ -81,34 +88,34 @@ class DoctorReplayChat extends StatelessWidget {
color: Color(0xFF2B353E)))
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// TODO: move to doctor profile
},
child: RichText(
text: TextSpan(
style: TextStyle(
fontSize: 1.6 *
SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text:
'Tap here to view patient profile'
.toString(),
style: TextStyle(
fontFamily: 'Poppins',
fontSize: 12)),
],
),
),
),
],
),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// InkWell(
// onTap: () {
// // TODO: move to doctor profile
// },
// child: RichText(
// text: TextSpan(
// style: TextStyle(
// fontSize: 1.6 *
// SizeConfig.textMultiplier,
// color: Colors.black),
// children: <TextSpan>[
// new TextSpan(
// text:
// 'Tap here to view patient profile'
// .toString(),
// style: TextStyle(
// fontFamily: 'Poppins',
// fontSize: 12)),
// ],
// ),
// ),
// ),
// ],
// ),
],
),
),
@ -137,34 +144,57 @@ class DoctorReplayChat extends StatelessWidget {
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 5),
width: 60,
height: 60,
child: Image.asset(
1 == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
margin: EdgeInsets.only(top: 5),
width: 60,
height: 60,
child: Image.asset(
1 == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
Divider(),
SizedBox(width: 10,),
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: AppText(
reply.patientName
.toString(),
fontSize: 14,
fontFamily: 'Poppins',
color: Colors.white,
fontWeight: FontWeight.bold,
// fontSize: 18
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
"07 Jan 2021",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
reply.createdOn !=null?DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w600,
color: Colors.white,
// fontSize: 18
fontSize: 14,
),
AppText(
"07:00 PM",
fontSize: 2.5 * SizeConfig.textMultiplier,
reply.createdOn !=null?DateUtils.getHour(DateUtils.getDateTimeFromServerFormat(reply.createdOn)):DateUtils.getHour(DateTime.now()),
fontSize: 14,
fontFamily: 'Poppins',
color: Colors.white,
// fontSize: 18
@ -187,7 +217,7 @@ class DoctorReplayChat extends StatelessWidget {
child: Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
"This procedure should be taken only when the patient is below 99o",
reply.remarks,
fontSize: 15,
fontFamily: 'Poppins',
color: Colors.white,
@ -203,91 +233,91 @@ class DoctorReplayChat extends StatelessWidget {
),
),
SizedBox(height: 30,),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
// color: Color(0xFF2B353E),
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white,// Color(0xFF2B353E),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: HexColor('#707070') ,
width: 0.30),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(top: 5),
width: 60,
height: 60,
child: Image.asset(
1 == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
Column(
children: [
AppText(
"07 Jan 2021",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
// fontSize: 18
),
AppText(
"07:00 PM",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
// fontSize: 18
),
],
),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
"This procedure should be taken only when the patient is below 99o",
fontSize: 15,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
// fontSize: 18
),
),
),
],
),
],
),
],
),
),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Container(
// // color: Color(0xFF2B353E),
// width: MediaQuery.of(context).size.width * 0.8,
// padding: EdgeInsets.all(5),
// decoration: BoxDecoration(
// color: Colors.white,// Color(0xFF2B353E),
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// border: Border.all(
// color: HexColor('#707070') ,
// width: 0.30),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(top: 5),
// width: 60,
// height: 60,
// child: Image.asset(
// 1 == 1
// ? 'assets/images/male_avatar.png'
// : 'assets/images/female_avatar.png',
// fit: BoxFit.cover,
// ),
// ),
// Column(
// children: [
// AppText(
// "07 Jan 2021",
// fontSize: 2.5 * SizeConfig.textMultiplier,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// AppText(
// "07:00 PM",
// fontSize: 2.5 * SizeConfig.textMultiplier,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// ],
// ),
// ],
// ),
// SizedBox(
// height: 10,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Column(
// children: [
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// width: MediaQuery.of(context).size.width * 0.7,
// child: AppText(
// "This procedure should be taken only when the patient is below 99o",
// fontSize: 15,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ],
// ),
// ),
// ],
// ),
],
),
),
@ -296,48 +326,114 @@ class DoctorReplayChat extends StatelessWidget {
],
),
),
],
),
),
bottomSheet: Container(
width: double.infinity,
// height: MediaQuery.of(context).size.height * 0.12,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FractionallySizedBox(
Positioned(
bottom: 0,
child: Container(
child: TextFields(
borderRadius: 0,
hasLabelText: msgController.text != ''
? true
: false,
showLabelText: false,
hintText: "\n"+TranslationBase
.of(context)
.typeHereToReply,
fontSize: 13.5,
width:MediaQuery.of(context).size.width * 1,
// height: MediaQuery.of(context).size.height * 0.12,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FractionallySizedBox(
child: Container(
child: TextFields(
borderRadius: 0,
hasLabelText: msgController.text != ''
? true
: false,
showLabelText: false,
hintText: "\n"+TranslationBase
.of(context)
.typeHereToReply,
fontSize: 13.5,
suffixIcon: FontAwesomeIcons.arrowRight,
suffixIconColor: Colors.green,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 50,
minLines: 3,
controller: msgController,
validator: (value) {
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
suffixIcon: FontAwesomeIcons.arrowRight,
suffixIconColor: Colors.green,
onSuffixTap: ()async {
await model.replay(msgController.text, reply);
if(model.state == ViewState.ErrorLocal) {
helpers.showErrorToast("An error happened while you are replaying");
} else {
DrAppToastMsg.showSuccesToast("Thank you for your replay ");
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplyScreen()));
}
},
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 50,
minLines: 3,
controller: msgController,
validator: (value) {
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
),
],
),
),
),
)
],
),
)
),
// bottomSheet: Container(
// width: double.infinity,
// // height: MediaQuery.of(context).size.height * 0.12,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// FractionallySizedBox(
// child: Container(
// child: TextFields(
// borderRadius: 0,
// hasLabelText: msgController.text != ''
// ? true
// : false,
// showLabelText: false,
// hintText: "\n"+TranslationBase
// .of(context)
// .typeHereToReply,
// fontSize: 13.5,
//
// suffixIcon: FontAwesomeIcons.arrowRight,
// suffixIconColor: Colors.green,
// onSuffixTap: (){
// model.replay(msgController.text, reply);
// },
// // hintColor: Colors.black,
// fontWeight: FontWeight.w600,
// maxLines: 50,
// minLines: 3,
// controller: msgController,
// validator: (value) {
// if (value == null || value == "")
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// }),
//
// ),
// ),
// ],
// ),
// )
));
}
}

@ -39,12 +39,12 @@ class DoctorReplyScreen extends StatelessWidget {
children:
model.listDoctorWorkingHoursTable.map((reply) {
return InkWell(
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (BuildContext context) =>
// DoctorReplayChat(reply: reply)));
onTap: reply.status != 2?null:() {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(reply: reply)));
},
child: DoctorReplyWidget(reply: reply),
);

@ -50,7 +50,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: widget.reply.status==2 ? TranslationBase.of(context).replied :TranslationBase.of(context).unReplied ,
text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied ,
style: TextStyle(
color: widget.reply.status == 2
? Color(0xFF2E303A)

Loading…
Cancel
Save