|
|
@ -28,8 +28,12 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
if(reply.doctorResponse.isNotEmpty){
|
|
|
|
|
|
|
|
msgController.text = reply.doctorResponse;
|
|
|
|
|
|
|
|
}
|
|
|
|
return BaseView<DoctorReplayViewModel>(
|
|
|
|
return BaseView<DoctorReplayViewModel>(
|
|
|
|
onModelReady: (model) async {},
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
|
|
|
},
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
@ -103,7 +107,7 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
SizedBox(height: 30,),
|
|
|
|
SizedBox(height: 30,),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
// color: Color(0xFF2B353E),
|
|
|
|
// color: Color(0xFF2B353E),
|
|
|
|
width: MediaQuery.of(context).size.width * 0.9,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.8,
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Color(0xFF2B353E),
|
|
|
|
color: Color(0xFF2B353E),
|
|
|
@ -128,8 +132,8 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: 5),
|
|
|
|
margin: EdgeInsets.only(top: 5),
|
|
|
|
width: 60,
|
|
|
|
width: 50,
|
|
|
|
height: 60,
|
|
|
|
height: 50,
|
|
|
|
child: Image.asset(
|
|
|
|
child: Image.asset(
|
|
|
|
reply.gender == 1
|
|
|
|
reply.gender == 1
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
@ -140,7 +144,7 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
Divider(),
|
|
|
|
Divider(),
|
|
|
|
SizedBox(width: 10,),
|
|
|
|
SizedBox(width: 10,),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: MediaQuery.of(context).size.width * 0.35,
|
|
|
|
width: MediaQuery.of(context).size.width * 0.31,
|
|
|
|
child: AppText(
|
|
|
|
child: AppText(
|
|
|
|
reply.patientName
|
|
|
|
reply.patientName
|
|
|
|
.toString(),
|
|
|
|
.toString(),
|
|
|
@ -152,7 +156,7 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 0),
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
launch("tel://" +reply.mobileNumber);
|
|
|
|
launch("tel://" +reply.mobileNumber);
|
|
|
@ -172,7 +176,7 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
|
|
|
|
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
|
|
|
|
fontWeight: FontWeight
|
|
|
|
fontWeight: FontWeight
|
|
|
|
.w600,
|
|
|
|
.w500,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -217,6 +221,113 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 30,),
|
|
|
|
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(
|
|
|
|
|
|
|
|
previousModel.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(
|
|
|
|
|
|
|
|
previousModel.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
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -248,9 +359,9 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
suffixIconColor: Colors.green,
|
|
|
|
suffixIconColor: Colors.green,
|
|
|
|
onSuffixTap: ()async {
|
|
|
|
onSuffixTap: ()async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model.createDoctorResponse(msgController.text, reply);
|
|
|
|
await previousModel.createDoctorResponse(msgController.text, reply);
|
|
|
|
if(model.state == ViewState.ErrorLocal) {
|
|
|
|
if(previousModel.state == ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(previousModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
DrAppToastMsg.showSuccesToast("Thank you for your replay ");
|
|
|
|
DrAppToastMsg.showSuccesToast("Thank you for your replay ");
|
|
|
|
await previousModel.getDoctorReply();
|
|
|
|
await previousModel.getDoctorReply();
|
|
|
@ -263,7 +374,7 @@ class DoctorReplayChat extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
// hintColor: Colors.black,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
maxLines: 50,
|
|
|
|
maxLines: 50,
|
|
|
|
minLines: 3,
|
|
|
|
minLines: 3,
|
|
|
|
controller: msgController,
|
|
|
|
controller: msgController,
|
|
|
|