doctor header review on tap improvement.

merge-requests/417/merge
Sikander Saleem 3 years ago
parent 5410b826c3
commit df31c82fd5

@ -1,5 +1,6 @@
class HeaderModel {
String doctorName;
int doctorId;
String doctorImageURL;
List<String> speciality;
String invoiceNo;
@ -12,6 +13,6 @@ class HeaderModel {
int totalReviews;
String email;
HeaderModel(this.doctorName, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, this.actualDoctorRate,
this.totalReviews, this.email);
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate,
this.actualDoctorRate, this.totalReviews, this.email);
}

@ -74,6 +74,7 @@ class _BookConfirmState extends State<BookConfirm> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",

@ -60,6 +60,7 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",

@ -103,6 +103,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",

@ -70,6 +70,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",
@ -191,7 +192,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white,
disabledColor: CustomColors.green,
onPressed: () async {
print(widget.patientShareResponse.appointmentNo);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog(
context,
widget.dateTime,
@ -201,7 +202,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
widget.appoTimeFormatted,
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
navigateToBookSuccess(context);
},
);
},

@ -94,6 +94,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
DoctorHeader(
headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
widget.appo.doctorID,
widget.appo.doctorImageURL,
widget.appo.doctorSpeciality,
"",
@ -107,7 +108,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"",
//model.user.emailAddress,
),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
isNeedToShowButton:
(widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
@ -357,13 +359,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
),

@ -41,10 +41,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(() {
setState(() {
});
setState(() {});
});
}
@ -61,7 +58,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
@ -70,6 +67,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
DoctorHeader(
headerModel: HeaderModel(
widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
widget.appointmentAllHistoryResultList.doctorID,
widget.appointmentAllHistoryResultList.doctorImageURL,
widget.appointmentAllHistoryResultList.doctorSpeciality,
"",
@ -83,7 +81,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
"",
//model.user.emailAddress,
),
isNeedToShowButton: _tabController.index==0?true:projectViewModel.havePrivilege(15),
isNeedToShowButton: _tabController.index == 0 ? true : projectViewModel.havePrivilege(15),
showConfirmMessageDialog: true,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {

@ -27,8 +27,7 @@ class InvoiceDetail extends StatefulWidget {
final DentalInvoiceDetailResponse dentalInvoiceDetailResponse;
final BuildContext context;
InvoiceDetail(this.doctor, this.listDentalAppointments,
this.dentalInvoiceDetailResponse, this.context);
InvoiceDetail(this.doctor, this.listDentalAppointments, this.dentalInvoiceDetailResponse, this.context);
@override
_InvoiceDetailState createState() => _InvoiceDetailState();
@ -50,11 +49,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
ProjectViewModel projectViewModel = Provider.of(context);
generateInvoiceDetails();
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle != null
? widget.doctor.doctorTitle.toString()
: TranslationBase.of(context).dr +
" " +
widget.doctor.name.toString(),
appBarTitle: widget.doctor.doctorTitle != null ? widget.doctor.doctorTitle.toString() : TranslationBase.of(context).dr + " " + widget.doctor.name.toString(),
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
@ -67,6 +62,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
widget.doctor.clinicName,
@ -76,7 +72,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.doctor.noOfPatientsRate,
widget.doctor.noOfPatientsRate ?? 0,
projectViewModel.user.emailAddress),
onTap: () {
sendInvoiceEmail();
@ -86,8 +82,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
@ -112,8 +107,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -121,29 +115,12 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(TranslationBase.of(context).cardDetail,
style: TextStyle(
color: Colors.black,
letterSpacing: -0.64,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
myRichText(
TranslationBase.of(context).insuranceCompany +
": ",
widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].companyName,
projectViewModel.isArabic),
myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic),
myRichText(
TranslationBase.of(context).insuranceID + ": ",
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.insuranceID !=
null
? widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].insuranceID
: "N/A",
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A",
projectViewModel.isArabic),
],
),
@ -155,8 +132,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -164,13 +140,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(
TranslationBase.of(context).totalBalance,
style: TextStyle(
letterSpacing: -0.64,
color: Colors.black,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).totalBalance, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
width: double.infinity,
@ -178,15 +148,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).discount),
child: _getNormalText(TranslationBase.of(context).discount),
),
Expanded(
child: _getNormalText(
this.totalDiscount.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.totalDiscount.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -198,26 +163,13 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context)
.totalVAT
.toString() +
" (" +
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.listConsultation[0]
.vATPercentage
.toString() +
"%): "),
child: _getNormalText(TranslationBase.of(context).totalVAT.toString() +
" (" +
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() +
"%): "),
),
Expanded(
child: _getNormalText(
num.tryParse(this.totalVAT.toString())
.toStringAsFixed(2) +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(num.tryParse(this.totalVAT.toString()).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -229,15 +181,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).total),
child: _getNormalText(TranslationBase.of(context).total),
),
Expanded(
child: _getNormalText(
this.subTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.subTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -249,15 +196,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).paid),
child: _getNormalText(TranslationBase.of(context).paid),
),
Expanded(
child: _getNormalText(
this.grandTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.grandTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -284,10 +226,8 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
List<ListConsultation> listConsultations = new List();
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation
.forEach((item) {
var i = listConsultations
.indexWhere((x) => x.procedureID == item.procedureID);
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((item) {
var i = listConsultations.indexWhere((x) => x.procedureID == item.procedureID);
if (i <= -1) {
listConsultations.add(item);
}
@ -308,16 +248,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
GifLoaderDialogUtils.showMyDialog(widget.context);
MyInvoicesService myInvoicesService = new MyInvoicesService();
myInvoicesService
.sendDentalAppointmentInvoiceEmail(
widget.listDentalAppointments.projectID,
widget.listDentalAppointments.appointmentNo,
widget.context)
.then((res) {
myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID, widget.listDentalAppointments.appointmentNo, widget.context).then((res) {
GifLoaderDialogUtils.hideDialog(widget.context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(
message: TranslationBase.of(widget.context).emailSentSuccessfully);
AppToast.showSuccessToast(message: TranslationBase.of(widget.context).emailSentSuccessfully);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -342,37 +276,17 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
],
),
);
for (int i = 0;
i <
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length;
i++) {
for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
]),
);
}

@ -38,6 +38,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",

@ -49,6 +49,7 @@ class PrescriptionItemsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",

@ -40,6 +40,7 @@ class RadiologyDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: new HeaderModel(
finalRadiology.doctorName,
finalRadiology.doctorID,
finalRadiology.doctorImageURL,
finalRadiology.speciality,
finalRadiology.invoiceNo.toString(),

@ -44,6 +44,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
DoctorHeader(
headerModel: HeaderModel(
widget.patientLabOrder.doctorName,
widget.patientLabOrder.doctorID,
widget.patientLabOrder.doctorImageURL,
widget.patientLabOrder.speciality,
widget.billNo,

@ -1,6 +1,10 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
@ -27,7 +31,7 @@ class DoctorHeader extends StatelessWidget {
this.isNeedToShowButton = true,
this.buttonIcon,
this.showConfirmMessageDialog = true,
this.onRatingAndReviewTap})
@required this.onRatingAndReviewTap})
: super(key: key);
ProjectViewModel projectViewModel;
@ -100,7 +104,11 @@ class DoctorHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: onRatingAndReviewTap,
onTap: () {
if ((headerModel?.totalReviews ?? 0) > 0) {
getDoctorRatingsDetails(context);
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
@ -122,10 +130,10 @@ class DoctorHeader extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: onRatingAndReviewTap != null ? Colors.blue[600] : Color(0xff2B353E),
color: (headerModel?.totalReviews ?? 0) > 0 ? Colors.blue[600] : Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,
decoration: (headerModel?.totalReviews ?? 0) > 0 ? TextDecoration.underline : null,
),
),
],
@ -141,7 +149,8 @@ class DoctorHeader extends StatelessWidget {
},
child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
decoration: BoxDecoration(
color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -175,4 +184,220 @@ class DoctorHeader extends StatelessWidget {
),
);
}
void getDoctorRatingsDetails(context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorRateDetails> doctorDetailsList = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
res['DoctorRatingDetailsList'].forEach((v) {
doctorDetailsList.add(new DoctorRateDetails.fromJson(v));
});
showRatingDialog(doctorDetailsList, context);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
void showRatingDialog(List<DoctorRateDetails> doctorDetailsList, context) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
// height: 400.0,
width: MediaQuery.of(context).size.width * 0.8,
color: Colors.white,
child: Column(
children: [
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width,
color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: this.headerModel.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[1].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffB7B723),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[2].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEBA727),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[3].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEB7227),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[4].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffE20C0C),
),
),
),
],
),
),
Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Align(
alignment: FractionalOffset.bottomCenter,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 40.0,
child: RaisedButton(
elevation: 0.0,
color: Colors.white,
textColor: Colors.red,
hoverColor: Colors.transparent,
focusColor: Colors.transparent,
highlightColor: Colors.transparent,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
Navigator.of(context).pop();
},
child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
],
),
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
}
double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.headerModel.totalReviews) * 100;
return width;
}
}

Loading…
Cancel
Save