finish doctor response

merge-requests/783/head
Elham Rababh 3 years ago
parent 09ca6d2454
commit c31db4890b

@ -32,35 +32,7 @@ class DoctorReplyService extends BaseService {
}, body: _requestDoctorReply.toJson(),);
}
Future replay(
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks =
RequestAddReferredDoctorRemarks();
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo.toString();
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks =
referredDoctorRemarks;
_requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo;
_requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor;
await baseAppClient.post(
ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
print("succsss");
// model.referredDoctorRemarks = referredDoctorRemarks;
// listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] =
// model;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
);
}
Future createDoctorResponse(
Future createDoctorResponse(
CreateDoctorResponseModel createDoctorResponseModel) async {
hasError = false;
await baseAppClient.post(

@ -22,16 +22,6 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future replay(
String referredDoctorRemarks, ListGtMyPatientsQuestions model) async {
setState(ViewState.BusyLocal);
await _doctorReplyService.replay(referredDoctorRemarks, model);
if (_doctorReplyService.hasError) {
error = _doctorReplyService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future createDoctorResponse(
String response, ListGtMyPatientsQuestions model) async {

@ -1,9 +1,6 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
class ListGtMyPatientsQuestions {
String setupID;
int projectID;
@ -26,9 +23,9 @@ class ListGtMyPatientsQuestions {
String dateofBirth;
String mobileNumber;
String emailAddress;
int admissionNo;
int referringDoctor;
int lineItemNo;
int infoStatus;
String infoDesc;
String doctorResponse;
String age;
String genderDescription;
bool isVidaCall;
@ -55,9 +52,9 @@ class ListGtMyPatientsQuestions {
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.admissionNo,
this.referringDoctor,
this.lineItemNo,
this.infoStatus,
this.infoDesc,
this.doctorResponse,
this.age,
this.genderDescription,
this.isVidaCall});
@ -84,9 +81,9 @@ class ListGtMyPatientsQuestions {
dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress'];
admissionNo = json['AdmissionNo'];
referringDoctor = json['ReferringDoctor'];
lineItemNo = json['LineItemNo'];
infoStatus = json['InfoStatus'];
infoDesc = json['InfoDesc'];
doctorResponse = json['DoctorResponse'];
age = json['Age'];
genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall'];
@ -115,9 +112,9 @@ class ListGtMyPatientsQuestions {
data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress;
data['AdmissionNo'] = this.admissionNo;
data['ReferringDoctor'] = this.referringDoctor;
data['LineItemNo'] = this.lineItemNo;
data['InfoStatus'] = this.infoStatus;
data['InfoDesc'] = this.infoDesc;
data['DoctorResponse'] = this.doctorResponse;
data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall;
@ -125,3 +122,4 @@ class ListGtMyPatientsQuestions {
}
}

@ -28,8 +28,13 @@ class DoctorReplayChat extends StatelessWidget {
@override
Widget build(BuildContext context) {
if(reply.doctorResponse.isNotEmpty){
msgController.text = reply.doctorResponse;
}
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) async {},
onModelReady: (model) async {
model.getDoctorProfile();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
@ -103,7 +108,7 @@ class DoctorReplayChat extends StatelessWidget {
SizedBox(height: 30,),
Container(
// color: Color(0xFF2B353E),
width: MediaQuery.of(context).size.width * 0.9,
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color(0xFF2B353E),
@ -128,8 +133,8 @@ class DoctorReplayChat extends StatelessWidget {
children: [
Container(
margin: EdgeInsets.only(top: 5),
width: 60,
height: 60,
width: 50,
height: 50,
child: Image.asset(
reply.gender == 1
? 'assets/images/male_avatar.png'
@ -140,7 +145,7 @@ class DoctorReplayChat extends StatelessWidget {
Divider(),
SizedBox(width: 10,),
Container(
width: MediaQuery.of(context).size.width * 0.35,
width: MediaQuery.of(context).size.width * 0.31,
child: AppText(
reply.patientName
.toString(),
@ -152,7 +157,7 @@ class DoctorReplayChat extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 4),
margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell(
onTap: () {
launch("tel://" +reply.mobileNumber);
@ -172,7 +177,7 @@ class DoctorReplayChat extends StatelessWidget {
AppText(
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w600,
.w500,
color: Colors.white,
fontSize: 14,
),
@ -217,6 +222,113 @@ class DoctorReplayChat extends StatelessWidget {
),
),
SizedBox(height: 30,),
SizedBox(height: 30,),
Align(
alignment: Alignment.centerRight,
child: Container(
// color: Color(0xFF2B353E),
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: HexColor('#707070') ,
width: 0.30),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
margin: EdgeInsets.only(top: 5),
width: 50,
height: 50,
child: Image.asset(
model.doctorProfile.gender == 0
? '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.35,
child: AppText(
model.doctorProfile.doctorName,
fontSize: 14,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
// fontSize: 18
),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w500,
color: Color(0xFF2B353E),
fontSize: 14,
),
AppText(
reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
fontSize: 14,
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(
reply.doctorResponse,
fontSize: 15,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
// fontSize: 18
),
),
),
],
),
],
),
],
),
),
),
],
),
),
@ -263,7 +375,7 @@ class DoctorReplayChat extends StatelessWidget {
},
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w500,
maxLines: 50,
minLines: 3,
controller: msgController,

Loading…
Cancel
Save