|
|
|
@ -1,11 +1,14 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
@ -42,6 +45,8 @@ class _DoctorProfileState extends State<DoctorProfile>
|
|
|
|
|
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
|
|
|
|
|
List<DoctorRateDetails> doctorDetailsList = List();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_tabController = new TabController(
|
|
|
|
@ -150,19 +155,26 @@ class _DoctorProfileState extends State<DoctorProfile>
|
|
|
|
|
emptyIcon: Icons.star,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
"(" +
|
|
|
|
|
widget.doctor.noOfPatientsRate.toString() +
|
|
|
|
|
" " + TranslationBase.of(context).reviews + ")",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.blue[800],
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
)),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
getDoctorRatingsDetails();
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.0),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: Text(
|
|
|
|
|
"(" +
|
|
|
|
|
widget.doctor.noOfPatientsRate.toString() +
|
|
|
|
|
" " +
|
|
|
|
|
TranslationBase.of(context).reviews +
|
|
|
|
|
")",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.blue[800],
|
|
|
|
|
letterSpacing: 1.0,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
@ -213,6 +225,279 @@ class _DoctorProfileState extends State<DoctorProfile>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDoctorRatings() {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service.getDoctorsRating(widget.doctor.doctorID, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
print(res['NotesDoctorRatingList']);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDoctorRatingsDetails() {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.getDoctorsRatingDetails(widget.doctor.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);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void showRatingDialog(List<DoctorRateDetails> doctorDetailsList) {
|
|
|
|
|
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: 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
|
|
|
|
|
.widget
|
|
|
|
|
.doctor
|
|
|
|
|
.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.widget.doctor.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.widget.doctor.noOfPatientsRate.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) {
|
|
|
|
|
print(patientNumber);
|
|
|
|
|
print(this.widget.doctor.noOfPatientsRate);
|
|
|
|
|
var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100;
|
|
|
|
|
print(width);
|
|
|
|
|
return width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getPatientData() async {
|
|
|
|
|
if (await sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data =
|
|
|
|
|