Rating dialog updates

merge-update-with-lab-changes
haroon amjad 4 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_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

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

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

@ -11,8 +11,9 @@ class HeaderModel {
int doctorRate;
int actualDoctorRate;
int totalReviews;
String decimalDoctorRate;
String 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);
this.actualDoctorRate, this.totalReviews, this.email, {this.decimalDoctorRate = null});
}

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

@ -106,6 +106,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate,
"",
decimalDoctorRate: widget.appo.decimalDoctorRate.toString()
//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,
@ -326,12 +327,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
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))),
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: 5.0),

@ -53,7 +53,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
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(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(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));

@ -220,24 +220,38 @@ class DoctorHeader extends StatelessWidget {
child: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
// height: 400.0,
width: MediaQuery.of(context).size.width * 0.8,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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))),
padding: EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: RatingBar.readOnly(
initialRating: this.headerModel.actualDoctorRate.toDouble(),
size: 35.0,
@ -249,12 +263,17 @@ class DoctorHeader extends StatelessWidget {
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))),
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
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(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
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(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
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(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
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(
margin: EdgeInsets.only(bottom: 30.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
width: 100.0,
@ -352,34 +408,40 @@ class DoctorHeader extends StatelessWidget {
),
],
),
),
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)),
),
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)),
),
],
),
),
// 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) {
var width = (patientNumber / this.headerModel.totalReviews) * 100;
return width;
return width.roundToDouble();
}
}

Loading…
Cancel
Save