change the status of replay

merge-requests/811/head
Elham Rababh 5 years ago
parent ce6ec576dd
commit 1f3d1f68fb

@ -2549,19 +2549,24 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
"patientArrived":{ "patientArrived":{
"en":"Patient Arrived", "en":"Patient Arrived",
"ar":"تم الاتصال" "ar":"وصل المريض"
}, },
"calledAndNoResponse":{ "calledAndNoResponse":{
"en":"Called And No Response", "en":"Called And No Response",
"ar":"تم الاتصال" "ar":"تم الاتصال ولا يوجد رد"
}, },
"underProcess":{ "underProcess":{
"en":"Under Process", "en":"Under Process",
"ar":"تم الاتصال" "ar":"تحت التجهيز"
}, },
"textResponse":{ "textResponse":{
"en":"Text Response", "en":"Text Response",
"ar":"تم الاتصال" "ar":"استجابة النص"
}
,
"requestType":{
"en":"Request Type",
"ar":"نوع الطلب"
} }
}; };

@ -1,7 +1,5 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
class ListGtMyPatientsQuestions { class ListGtMyPatientsQuestions {
Null rowID;
String setupID; String setupID;
int projectID; int projectID;
int transactionNo; int transactionNo;
@ -9,7 +7,7 @@ class ListGtMyPatientsQuestions {
int patientID; int patientID;
int doctorID; int doctorID;
int requestType; int requestType;
DateTime requestDate; String requestDate;
String requestTime; String requestTime;
String remarks; String remarks;
int status; int status;
@ -26,12 +24,18 @@ class ListGtMyPatientsQuestions {
int infoStatus; int infoStatus;
String infoDesc; String infoDesc;
String doctorResponse; String doctorResponse;
dynamic responseDate;
int memberID;
String memberName;
String memberNameN;
String age; String age;
String genderDescription; String genderDescription;
bool isVidaCall; bool isVidaCall;
String requestTypeDescription;
ListGtMyPatientsQuestions( ListGtMyPatientsQuestions(
{this.setupID, {this.rowID,
this.setupID,
this.projectID, this.projectID,
this.transactionNo, this.transactionNo,
this.patientType, this.patientType,
@ -55,11 +59,17 @@ class ListGtMyPatientsQuestions {
this.infoStatus, this.infoStatus,
this.infoDesc, this.infoDesc,
this.doctorResponse, this.doctorResponse,
this.responseDate,
this.memberID,
this.memberName,
this.memberNameN,
this.age, this.age,
this.genderDescription, this.genderDescription,
this.isVidaCall}); this.isVidaCall,
this.requestTypeDescription});
ListGtMyPatientsQuestions.fromJson(Map<String, dynamic> json) { ListGtMyPatientsQuestions.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
transactionNo = json['TransactionNo']; transactionNo = json['TransactionNo'];
@ -67,7 +77,7 @@ class ListGtMyPatientsQuestions {
patientID = json['PatientID']; patientID = json['PatientID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
requestType = json['RequestType']; requestType = json['RequestType'];
requestDate = AppDateUtils.convertStringToDate(json['RequestDate']) ; requestDate = json['RequestDate'];
requestTime = json['RequestTime']; requestTime = json['RequestTime'];
remarks = json['Remarks']; remarks = json['Remarks'];
status = json['Status']; status = json['Status'];
@ -84,13 +94,19 @@ class ListGtMyPatientsQuestions {
infoStatus = json['InfoStatus']; infoStatus = json['InfoStatus'];
infoDesc = json['InfoDesc']; infoDesc = json['InfoDesc'];
doctorResponse = json['DoctorResponse']; doctorResponse = json['DoctorResponse'];
responseDate = json['ResponseDate'];
memberID = json['MemberID'];
memberName = json['MemberName'];
memberNameN = json['MemberNameN'];
age = json['Age']; age = json['Age'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall']; isVidaCall = json['IsVidaCall'];
requestTypeDescription = json['RequestTypeDescription'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['TransactionNo'] = this.transactionNo; data['TransactionNo'] = this.transactionNo;
@ -115,11 +131,14 @@ class ListGtMyPatientsQuestions {
data['InfoStatus'] = this.infoStatus; data['InfoStatus'] = this.infoStatus;
data['InfoDesc'] = this.infoDesc; data['InfoDesc'] = this.infoDesc;
data['DoctorResponse'] = this.doctorResponse; data['DoctorResponse'] = this.doctorResponse;
data['ResponseDate'] = this.responseDate;
data['MemberID'] = this.memberID;
data['MemberName'] = this.memberName;
data['MemberNameN'] = this.memberNameN;
data['Age'] = this.age; data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription; data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall; data['IsVidaCall'] = this.isVidaCall;
data['RequestTypeDescription'] = this.requestTypeDescription;
return data; return data;
} }
} }

@ -295,14 +295,14 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), widget.reply.responseDate !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.responseDate)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight fontWeight: FontWeight
.w500, .w500,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
), ),
AppText( AppText(
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), widget.reply.responseDate !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.responseDate)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),

@ -1378,6 +1378,7 @@ class TranslationBase {
String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode];
String get underProcess => localizedValues['underProcess'][locale.languageCode]; String get underProcess => localizedValues['underProcess'][locale.languageCode];
String get textResponse => localizedValues['textResponse'][locale.languageCode]; String get textResponse => localizedValues['textResponse'][locale.languageCode];
String get requestType => localizedValues['requestType'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -8,6 +8,7 @@ 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/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -31,12 +32,9 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
return Container( return Container(
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: bgColor:
widget.reply.infoStatus == 4 widget.reply.status == 2 ? Colors.green[600] : Color(0xFFD02127),
? IN_PROGRESS_COLOR
: widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600],
hasBorder: false, hasBorder: false,
widget: Container( widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -51,12 +49,16 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Colors.black), color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: widget.reply.infoStatus ==1? TranslationBase.of(context).replayCallStatus:widget.reply.infoStatus ==2? TranslationBase.of(context).patientArrived:widget.reply.infoStatus ==3? TranslationBase.of(context).calledAndNoResponse:widget.reply.infoStatus ==4? TranslationBase.of(context).underProcess:widget.reply.infoStatus ==6? TranslationBase.of(context).textResponse:'' ,//widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , //TODO Elham* add translation
text: widget.reply.status == 2
? TranslationBase.of(context).active
: widget.reply.status == 1
? TranslationBase.of(context).onHold
: TranslationBase.of(context).cancelled,
style: TextStyle( style: TextStyle(
color: widget.reply.infoStatus == 4 color: widget.reply.status == 2
? IN_PROGRESS_COLOR ? Colors.green[600]
: widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600], : Color(0xFFD02127),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 2.0 * SizeConfig.textMultiplier)), fontSize: 2.0 * SizeConfig.textMultiplier)),
@ -90,8 +92,8 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
widget.reply.createdOn) widget.reply.createdOn)
.hour .hour
.toString() .toString() +
+ ":"+ ":" +
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(
widget.reply.createdOn) widget.reply.createdOn)
.minute .minute
@ -99,7 +101,6 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
], ],
), ),
], ],
@ -163,7 +164,6 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
@ -179,58 +179,89 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CustomRow(
RichText( label: TranslationBase.of(context).fileNumber,
text: new TextSpan( value: widget.reply.patientID.toString(),
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNumber,
style: TextStyle(
fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')),
new TextSpan(
text: widget.reply.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
), ),
CustomRow(
label: TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}",
), ),
// CustomRow(
// label:TranslationBase.of(context).requestType+
// ": ",
// value: "${widget.reply.requestTypeDescription}",
// ),
Container( Container(
width: MediaQuery.of(context).size.width*0.45, width: MediaQuery.of(context).size.width * 0.5,
child: RichText( child: RichText(
maxLines: 3,
overflow: TextOverflow.ellipsis,
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize:
color: Colors.black, 1.3 * SizeConfig.textMultiplier,
fontFamily: 'Poppins', color: Color(0xFF575757)),
),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context).age + text: TranslationBase.of(context)
.requestType +
": ", ": ",
style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), style: TextStyle(
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.8,
color: Color(0xFF575757),
//TranslationBase.of(context).doctorResponse + " : ",
)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", "${widget.reply.requestTypeDescription}",
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), )),
], ],
), ),
), ),
) ),
], CustomRow(
width: MediaQuery.of(context).size.width * .3,
label: TranslationBase.of(context).infoStatus +
":",
value: widget.reply.infoStatus == 1
? TranslationBase.of(context)
.replayCallStatus
: widget.reply.infoStatus == 2
? TranslationBase.of(context)
.patientArrived
: widget.reply.infoStatus == 3
? TranslationBase.of(context)
.calledAndNoResponse
: widget.reply.infoStatus == 4
? TranslationBase.of(context)
.underProcess
: widget.reply.infoStatus == 6
? TranslationBase.of(
context)
.textResponse
: '',
), ),
SizedBox(
height: 10,
),
],
),
], ],
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
child: RichText( child: RichText(
@ -238,24 +269,24 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, fontSize: 1.3 * SizeConfig.textMultiplier,
color: Colors.black), color: Color(0xFF575757)),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", text:
style: "Patient Question: ", //TranslationBase.of(context).doctorResponse + " : ",
TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), ),
new TextSpan( new TextSpan(
text: widget.reply?.remarks?.trim() ?? '', text: widget.reply?.remarks?.trim() ?? '',
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), )),
fontSize: 12)),
], ],
), ),
), ),
), ),
],) ],
)
], ],
), ),
// Container( // Container(

@ -6,6 +6,7 @@ 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/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -470,37 +471,4 @@ class PatientCard extends StatelessWidget {
} }
} }
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value,
}) : super(key: key);
final String label;
final String value;
@override
Widget build(BuildContext context) {
return Row(
children: [
AppText(
label,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.8,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
value,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
);
}
}

@ -0,0 +1,43 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/material.dart';
import '../app_texts_widget.dart';
class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value, this.labelSize, this.valueSize, this.width,
}) : super(key: key);
final String label;
final String value;
final double labelSize;
final double valueSize;
final double width;
@override
Widget build(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
label,
fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.8,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
value,
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
);
}
}
Loading…
Cancel
Save