Rating dialog updates

merge-requests/440/head
haroon amjad 5 years ago
parent 4a2e01b8b1
commit 58c78656bf

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -39,6 +39,7 @@ class AppoitmentAllHistoryResultList {
String doctorImageURL; String doctorImageURL;
String doctorNameObj; String doctorNameObj;
int doctorRate; int doctorRate;
double decimalDoctorRate;
List<String> doctorSpeciality; List<String> doctorSpeciality;
String doctorTitle; String doctorTitle;
int gender; int gender;
@ -108,6 +109,7 @@ class AppoitmentAllHistoryResultList {
this.doctorImageURL, this.doctorImageURL,
this.doctorNameObj, this.doctorNameObj,
this.doctorRate, this.doctorRate,
this.decimalDoctorRate,
this.doctorSpeciality, this.doctorSpeciality,
this.doctorTitle, this.doctorTitle,
this.gender, this.gender,
@ -176,6 +178,7 @@ class AppoitmentAllHistoryResultList {
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj']; doctorNameObj = json['DoctorNameObj'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorSpeciality = json['DoctorSpeciality'] != null doctorSpeciality = json['DoctorSpeciality'] != null
? json['DoctorSpeciality'].cast<String>() ? json['DoctorSpeciality'].cast<String>()
: ["null"]; : ["null"];
@ -250,6 +253,7 @@ class AppoitmentAllHistoryResultList {
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorNameObj'] = this.doctorNameObj; data['DoctorNameObj'] = this.doctorNameObj;
data['DoctorRate'] = this.doctorRate; data['DoctorRate'] = this.doctorRate;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorSpeciality'] = this.doctorSpeciality; data['DoctorSpeciality'] = this.doctorSpeciality;
data['DoctorTitle'] = this.doctorTitle; data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender; data['Gender'] = this.gender;

@ -35,6 +35,7 @@ class DoctorProfileList {
int actualDoctorRate; int actualDoctorRate;
String doctorImageURL; String doctorImageURL;
int doctorRate; int doctorRate;
double decimalDoctorRate;
String doctorTitleForProfile; String doctorTitleForProfile;
bool isAppointmentAllowed; bool isAppointmentAllowed;
String nationalityFlagURL; String nationalityFlagURL;
@ -79,6 +80,7 @@ class DoctorProfileList {
this.actualDoctorRate, this.actualDoctorRate,
this.doctorImageURL, this.doctorImageURL,
this.doctorRate, this.doctorRate,
this.decimalDoctorRate,
this.doctorTitleForProfile, this.doctorTitleForProfile,
this.isAppointmentAllowed, this.isAppointmentAllowed,
this.nationalityFlagURL, this.nationalityFlagURL,
@ -123,6 +125,7 @@ class DoctorProfileList {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
decimalDoctorRate = json['DecimalDoctorRate'];
doctorTitleForProfile = json['DoctorTitleForProfile']; doctorTitleForProfile = json['DoctorTitleForProfile'];
isAppointmentAllowed = json['IsAppointmentAllowed']; isAppointmentAllowed = json['IsAppointmentAllowed'];
nationalityFlagURL = json['NationalityFlagURL']; nationalityFlagURL = json['NationalityFlagURL'];
@ -169,6 +172,7 @@ class DoctorProfileList {
data['ActualDoctorRate'] = this.actualDoctorRate; data['ActualDoctorRate'] = this.actualDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate; data['DoctorRate'] = this.doctorRate;
data['DecimalDoctorRate'] = this.decimalDoctorRate;
data['DoctorTitleForProfile'] = this.doctorTitleForProfile; data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed; data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['NationalityFlagURL'] = this.nationalityFlagURL; data['NationalityFlagURL'] = this.nationalityFlagURL;

@ -11,8 +11,9 @@ class HeaderModel {
int doctorRate; int doctorRate;
int actualDoctorRate; int actualDoctorRate;
int totalReviews; int totalReviews;
String decimalDoctorRate;
String email; String email;
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, 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); this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = null});
} }

@ -115,6 +115,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
widget.doctor.actualDoctorRate, widget.doctor.actualDoctorRate,
widget.docProfileList.noOfPatientsRate, widget.docProfileList.noOfPatientsRate,
"", "",
decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(),
), ),
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,

@ -106,6 +106,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.actualDoctorRate, widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate, widget.appo.noOfPatientsRate,
"", "",
decimalDoctorRate: widget.appo.decimalDoctorRate.toString()
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
@ -326,12 +327,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
child: Column( child: Column(
children: [ children: [
Container( Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),

@ -53,7 +53,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
hmgServices.clear(); hmgServices.clear();
hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin));
hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin));

@ -220,24 +220,38 @@ class DoctorHeader extends StatelessWidget {
child: Dialog( child: Dialog(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
// height: 400.0,
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
color: Colors.white, color: Colors.white,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
color: Theme.of(context).primaryColor, padding: EdgeInsets.all(20.0),
margin: EdgeInsets.only(bottom: 5.0), child: Row(
padding: EdgeInsets.all(10.0), mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), children: [
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
IconButton(
icon: Icon(
Icons.close,
color: Colors.black,
),
onPressed: () {
Navigator.pop(context);
},
),
],
)),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(margin: EdgeInsets.only(left: 20.0), child: Text(this.headerModel.decimalDoctorRate != null ? this.headerModel.decimalDoctorRate : this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black, fontWeight: FontWeight.bold))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.symmetric(horizontal: 20.0),
alignment: Alignment.center,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: this.headerModel.actualDoctorRate.toDouble(), initialRating: this.headerModel.actualDoctorRate.toDouble(),
size: 35.0, size: 35.0,
@ -249,12 +263,17 @@ class DoctorHeader extends StatelessWidget {
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
), ),
],
),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.symmetric(horizontal: 20.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))), child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
@ -272,9 +291,18 @@ class DoctorHeader extends StatelessWidget {
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
), ),
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
@ -292,9 +320,18 @@ class DoctorHeader extends StatelessWidget {
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
), ),
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
@ -312,9 +349,18 @@ class DoctorHeader extends StatelessWidget {
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
), ),
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
@ -332,9 +378,19 @@ class DoctorHeader extends StatelessWidget {
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 30.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Container( Container(
width: 100.0, width: 100.0,
@ -352,34 +408,40 @@ class DoctorHeader extends StatelessWidget {
), ),
], ],
), ),
),
Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
Container( Container(
margin: EdgeInsets.only(top: 0.0), margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Align( child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
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)),
),
), ),
],
), ),
), ),
// 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)),
// ),
// ),
// ),
// ),
], ],
), ),
), ),
@ -398,6 +460,6 @@ class DoctorHeader extends StatelessWidget {
double getRatingWidth(int patientNumber) { double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.headerModel.totalReviews) * 100; var width = (patientNumber / this.headerModel.totalReviews) * 100;
return width; return width.roundToDouble();
} }
} }

Loading…
Cancel
Save