|
|
@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
|
|
@ -14,15 +15,13 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RateAppointmentClinic extends StatefulWidget {
|
|
|
|
class RateAppointmentClinic extends StatefulWidget {
|
|
|
|
final AppointmentDetails appointmentDetails;
|
|
|
|
final AppointmentDetails appointmentDetails;
|
|
|
|
final String doctorNote;
|
|
|
|
final String doctorNote;
|
|
|
|
final int doctorRate;
|
|
|
|
final int doctorRate;
|
|
|
|
|
|
|
|
|
|
|
|
RateAppointmentClinic(
|
|
|
|
RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote});
|
|
|
|
{this.appointmentDetails, this.doctorRate, this.doctorNote});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_RateAppointmentClinicState createState() => _RateAppointmentClinicState();
|
|
|
|
_RateAppointmentClinicState createState() => _RateAppointmentClinicState();
|
|
|
@ -43,8 +42,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
appBar: AppBar(
|
|
|
|
appBar: AppBar(
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|
textTheme: TextTheme(
|
|
|
|
textTheme: TextTheme(
|
|
|
|
headline6:
|
|
|
|
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
|
|
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
title: Text('Rate'),
|
|
|
|
title: Text('Rate'),
|
|
|
|
leading: Builder(
|
|
|
|
leading: Builder(
|
|
|
@ -91,11 +89,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
LargeAvatar(
|
|
|
|
LargeAvatar(
|
|
|
|
url:
|
|
|
|
url: 'https://hmgwebservices.com/Images/Hospitals/' + model.appointmentDetails.projectID.toString() + '.jpg',
|
|
|
|
'https://hmgwebservices.com/Images/Hospitals/' +
|
|
|
|
|
|
|
|
model.appointmentDetails.projectID
|
|
|
|
|
|
|
|
.toString() +
|
|
|
|
|
|
|
|
'.jpg',
|
|
|
|
|
|
|
|
name: model.appointmentDetails.clinicName,
|
|
|
|
name: model.appointmentDetails.clinicName,
|
|
|
|
width: 110,
|
|
|
|
width: 110,
|
|
|
|
height: 110,
|
|
|
|
height: 110,
|
|
|
@ -112,9 +106,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
DateUtil.getMonthDayYearDateFormatted(
|
|
|
|
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)),
|
|
|
|
DateUtil.convertStringToDate(
|
|
|
|
|
|
|
|
model.appointmentDetails.appointmentDate)),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 8,
|
|
|
|
height: 8,
|
|
|
@ -146,10 +138,8 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
duration: Duration(milliseconds: 1000),
|
|
|
|
duration: Duration(milliseconds: 1000),
|
|
|
|
switchInCurve: Curves.elasticOut,
|
|
|
|
switchInCurve: Curves.elasticOut,
|
|
|
|
switchOutCurve: Curves.elasticIn,
|
|
|
|
switchOutCurve: Curves.elasticIn,
|
|
|
|
transitionBuilder:
|
|
|
|
transitionBuilder: (Widget child, Animation<double> animation) {
|
|
|
|
(Widget child, Animation<double> animation) {
|
|
|
|
return ScaleTransition(child: child, scale: animation);
|
|
|
|
return ScaleTransition(
|
|
|
|
|
|
|
|
child: child, scale: animation);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
key: ValueKey<int>(rating),
|
|
|
|
key: ValueKey<int>(rating),
|
|
|
@ -162,9 +152,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
iconSize: rating == (index + 1) ? 60 : 40,
|
|
|
|
iconSize: rating == (index + 1) ? 60 : 40,
|
|
|
|
// Theme.of(context).hintColor,
|
|
|
|
// Theme.of(context).hintColor,
|
|
|
|
icon: Image.asset('assets/images/' +
|
|
|
|
icon: Image.asset('assets/images/' + (index + 1).toString() + '.png')),
|
|
|
|
(index + 1).toString() +
|
|
|
|
|
|
|
|
'.png')),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -192,25 +180,33 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
|
|
|
|
if (rating > 0) {
|
|
|
|
if (rating > 0) {
|
|
|
|
model
|
|
|
|
model
|
|
|
|
.sendAppointmentRate(
|
|
|
|
.sendAppointmentRate(
|
|
|
|
rating,
|
|
|
|
rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note)
|
|
|
|
widget.appointmentDetails.appointmentNo,
|
|
|
|
|
|
|
|
widget.appointmentDetails.projectID,
|
|
|
|
|
|
|
|
widget.appointmentDetails.doctorID,
|
|
|
|
|
|
|
|
widget.appointmentDetails.clinicID,
|
|
|
|
|
|
|
|
note)
|
|
|
|
|
|
|
|
.then(
|
|
|
|
.then(
|
|
|
|
(value) => {
|
|
|
|
(value) => {
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
model
|
|
|
|
context,
|
|
|
|
.sendDoctorRate(
|
|
|
|
FadePage(
|
|
|
|
widget.doctorRate,
|
|
|
|
page: LandingPage(),
|
|
|
|
widget.appointmentDetails.appointmentNo,
|
|
|
|
),
|
|
|
|
widget.appointmentDetails.projectID,
|
|
|
|
)
|
|
|
|
widget.appointmentDetails.doctorID,
|
|
|
|
|
|
|
|
widget.appointmentDetails.clinicID,
|
|
|
|
|
|
|
|
note,
|
|
|
|
|
|
|
|
widget.appointmentDetails.appointmentDate,
|
|
|
|
|
|
|
|
widget.appointmentDetails.doctorName,
|
|
|
|
|
|
|
|
widget.appointmentDetails.projectName,
|
|
|
|
|
|
|
|
widget.appointmentDetails.clinicName)
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: LandingPage(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
AppToast.showErrorToast(message: 'please rate the clinic');
|
|
|
|
message: 'please rate the clinic');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
label: TranslationBase.of(context).submit,
|
|
|
|
label: TranslationBase.of(context).submit,
|
|
|
|