Merge branch 'haroon-new-design' into development_new_design_2.0

merge-update-with-lab-changes
haroon amjad 5 years ago
commit cbb9151b62

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4586" data-name="Path 4586" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,17.8A3.555,3.555,0,0,1,11.2,14.777L8.75,12.793a1.187,1.187,0,1,1,1.491-1.847l5.052,4.088A3.561,3.561,0,1,1,9.5,17.8Zm16.29,12.688a1.188,1.188,0,0,1-1.678.04,7.42,7.42,0,0,0-10.234,0,1.187,1.187,0,1,1-1.636-1.721,9.787,9.787,0,0,1,13.5,0A1.187,1.187,0,0,1,25.785,30.492Zm3.447-17.7-2.455,1.985a3.549,3.549,0,1,1-4.09.256l5.054-4.088a1.187,1.187,0,1,1,1.491,1.847Z" fill="#ca3332"/>
</svg>

After

Width:  |  Height:  |  Size: 614 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4587" data-name="Path 4587" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,14.243a2.374,2.374,0,1,1,2.374,2.374A2.378,2.378,0,0,1,9.5,14.243ZM27.383,28.895a1.192,1.192,0,0,1-1.681,0,9.72,9.72,0,0,0-13.429,0,1.187,1.187,0,0,1-1.678-1.678,11.869,11.869,0,0,1,16.788,0A1.188,1.188,0,0,1,27.383,28.895Zm-1.27-12.278a2.374,2.374,0,1,1,2.374-2.374A2.378,2.378,0,0,1,26.113,16.617Z" fill="#d56e6d"/>
</svg>

After

Width:  |  Height:  |  Size: 551 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4588" data-name="Path 4588" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,14.243a2.374,2.374,0,1,1,2.374,2.374A2.378,2.378,0,0,1,9.5,14.243Zm15.43,14.243H13.056a1.187,1.187,0,1,1,0-2.374H24.926a1.187,1.187,0,1,1,0,2.374Zm1.187-11.869a2.374,2.374,0,1,1,2.374-2.374A2.378,2.378,0,0,1,26.113,16.617Z" fill="#ca8432"/>
</svg>

After

Width:  |  Height:  |  Size: 474 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.981" height="37.982" viewBox="0 0 37.981 37.982">
<path id="Path_4589" data-name="Path 4589" d="M18.991,0A18.991,18.991,0,1,0,37.981,18.991,19.013,19.013,0,0,0,18.991,0ZM8.308,14.243A3.561,3.561,0,1,1,11.869,17.8,3.565,3.565,0,0,1,8.308,14.243ZM27.382,27.382a11.866,11.866,0,0,1-16.785,0A1.187,1.187,0,0,1,12.275,25.7a9.72,9.72,0,0,0,13.429,0,1.187,1.187,0,0,1,1.678,1.678ZM26.112,17.8a3.561,3.561,0,1,1,3.561-3.561A3.565,3.565,0,0,1,26.112,17.8Z" fill="#8ca742"/>
</svg>

After

Width:  |  Height:  |  Size: 524 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4590" data-name="Path 4590" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0Zm7.122,11.869a2.374,2.374,0,1,1-2.374,2.374A2.378,2.378,0,0,1,26.113,11.869Zm-14.243,0A2.374,2.374,0,1,1,9.5,14.243,2.378,2.378,0,0,1,11.869,11.869Zm7.122,21.365a14.275,14.275,0,0,1-13.7-10.36,1.188,1.188,0,0,1,1.142-1.51H31.549a1.183,1.183,0,0,1,.945.47,1.2,1.2,0,0,1,.2,1.04A14.275,14.275,0,0,1,18.991,33.234Z" fill="#20a16a"/>
</svg>

After

Width:  |  Height:  |  Size: 558 B

@ -1516,7 +1516,7 @@ const Map localizedValues = {
"RRTRequestSuccess": { "en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن" }, "RRTRequestSuccess": { "en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن" },
"rateDoctorAppo": { "en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين" }, "rateDoctorAppo": { "en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين" },
"invoice": { "en": "Invoice", "ar": "الفاتورة" }, "invoice": { "en": "Invoice", "ar": "الفاتورة" },
"requestedDate": { "en": "Reqeusted Date", "ar": "التاريخ " }, "requestedDate": { "en": "Requested Date", "ar": "التاريخ " },
"callDuration": { "en": "Call Duration", "ar": "مدة الاتصال" }, "callDuration": { "en": "Call Duration", "ar": "مدة الاتصال" },
"alreadyRated": { "en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً" }, "alreadyRated": { "en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً" },
"insuranceCompany": { "en": "Insurance Company", "ar": "شركة تأمين" }, "insuranceCompany": { "en": "Insurance Company", "ar": "شركة تأمين" },
@ -1526,4 +1526,6 @@ const Map localizedValues = {
"otherInfo": {"en": "Other details", "ar": "تفاصيل أخرى"}, "otherInfo": {"en": "Other details", "ar": "تفاصيل أخرى"},
"medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"}, "medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"},
"insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"},
"rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"},
"rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"},
}; };

@ -307,7 +307,7 @@ class _BookConfirmState extends State<BookConfirm> {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {

@ -451,7 +451,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID) .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
getToDoCount(); getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else { } else {

@ -75,13 +75,14 @@ class _ErOptionsState extends State<ErOptions> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: DdServicesPage())); // Navigator.push(context, FadePage(page: DdServicesPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: "ED", title: "ED",
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).service,
isPngImage: true, isPngImage: true,
isEnable: false,
), ),
), ),
InkWell( InkWell(

@ -162,13 +162,19 @@ class _SchedulePageState extends State<SchedulePage> {
weeks[index][index2]['WorkingHours'], weeks[index][index2]['WorkingHours'],
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
) ),
Icon(projectViewModel.isArabic
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined, size: 16.0),
], ],
) )
]))), ]))),
) ),
], ],
)))); )
)));
}, },
)), )),
PageViewIndicator( PageViewIndicator(

@ -179,33 +179,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}, },
); );
return; return;
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: PrescriptionReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate: startDate,
endDate: endDate,
location: prescriptionReport.remarks,
days: 1,
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
}, },
iconData: Icons.notifications_active, iconData: Icons.notifications_active,
color: Color(0xffEAEAEA), color: Color(0xffEAEAEA),

@ -1,27 +1,35 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
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/theme/colors.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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; 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:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.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({this.appointmentDetails, this.doctorRate, this.doctorNote}); RateAppointmentClinic(
{this.appointmentDetails, this.doctorRate, this.doctorNote});
@override @override
_RateAppointmentClinicState createState() => _RateAppointmentClinicState(); _RateAppointmentClinicState createState() => _RateAppointmentClinicState();
@ -34,164 +42,253 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>( return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
body: Scaffold( appBarTitle: TranslationBase.of(context).rateAppointment,
backgroundColor: Colors.grey[200], body: SingleChildScrollView(
appBar: AppBar( child: Container(
elevation: 0, padding: EdgeInsets.all(12),
textTheme: TextTheme( child: Column(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), crossAxisAlignment: CrossAxisAlignment.start,
), children: <Widget>[
title: Text('Rate'), SizedBox(
leading: Builder( height: 25,
builder: (BuildContext context) { ),
return IconButton( Text(
icon: Icon(Icons.menu), TranslationBase.of(context).lastAppointment,
color: Colors.white, style: TextStyle(
onPressed: () => Scaffold.of(context).openDrawer(), fontSize: 16,
); fontWeight: FontWeight.w600,
}, color: Color(0xff2B353E),
), letterSpacing: -0.64,
centerTitle: true, height: 23 / 16),
), ),
drawer: SafeArea(child: AppDrawer()), SizedBox(
body: FractionallySizedBox( height: 25,
widthFactor: 1, ),
child: SingleChildScrollView( Card(
child: Container( elevation: 0,
padding: EdgeInsets.all(12), shape: cardRadius(10),
child: Column( child: Padding(
children: <Widget>[ padding: const EdgeInsets.only(
SizedBox( left: 12, right: 12, top: 12, bottom: 12),
height: 25, child: Column(
), mainAxisSize: MainAxisSize.min,
Texts( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).lastAppointment, children: [
bold: true, Container(
color: Colors.black, margin: EdgeInsets.only(bottom: 10.0),
), child: Row(
SizedBox( mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 25, children: [
Text(
model.appointmentDetails.projectName,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
height: 25 / 16),
),
Text(
model.appointmentDetails.startTime,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
height: 25 / 16),
),
],
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
url:
'https://hmgwebservices.com/Images/Hospitals/' +
model.appointmentDetails.projectID
.toString() +
'.jpg',
width: 48,
height: 48,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
myRichText(
TranslationBase.of(context).clinic + ":",
model.appointmentDetails.projectName,
projectViewModel.isArabic),
myRichText(
TranslationBase.of(context).date + ":",
DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(model
.appointmentDetails
.appointmentDate)),
projectViewModel.isArabic),
],
),
),
],
),
],
), ),
Container( ),
width: double.infinity, ),
decoration: BoxDecoration( SizedBox(
borderRadius: BorderRadius.circular(15), height: 12,
color: Colors.white, ),
shape: BoxShape.rectangle, Container(
border: Border.all(color: Colors.white, width: 0.5), width: double.infinity,
), child: Card(
elevation: 0,
shape: cardRadius(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 8, Text(
), TranslationBase.of(context).rateClinic,
LargeAvatar( style: TextStyle(
url: 'https://hmgwebservices.com/Images/Hospitals/' + model.appointmentDetails.projectID.toString() + '.jpg', fontSize: 16,
name: model.appointmentDetails.clinicName, fontWeight: FontWeight.w600,
width: 110, color: Color(0xff2B353E),
height: 110, letterSpacing: -0.64,
), height: 23 / 16),
SizedBox(
height: 22,
),
Texts(
model.appointmentDetails.projectName,
fontSize: 22,
fontWeight: FontWeight.bold,
), ),
SizedBox( SizedBox(
height: 4, height: 12,
), ),
Texts( Row(
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)), mainAxisAlignment: MainAxisAlignment.center,
), children: <Widget>[
SizedBox( ...List.generate(
height: 8, 5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 300),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child,
Animation<double> animation) {
return ScaleTransition(
child: child, scale: animation);
},
child: rating == (index + 1)
? Container(
margin: EdgeInsets.only(
left: 3.0, right: 3.0),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(100),
border: Border.all(
width: 3,
color: CustomColors.green)),
key: ValueKey<int>(rating),
child: IconButton(
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: 35,
icon: SvgPicture.asset(
'assets/images/new/appointment-rating/' +
(index + 1).toString() +
'.svg'),
),
)
: Container(
key: ValueKey<int>(rating),
child: IconButton(
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: 35,
icon: SvgPicture.asset(
'assets/images/new/appointment-rating/' +
(index + 1).toString() +
'.svg'),
),
),
),
)
],
), ),
Texts(model.appointmentDetails.startTime),
SizedBox(
height: 8,
)
], ],
), ),
), ),
SizedBox( ),
height: 12,
),
Center(
child: Texts(
TranslationBase.of(context).rateClinic,
textAlign: TextAlign.center,
)),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(child: child, scale: animation);
},
child: Container(
key: ValueKey<int>(rating),
child: IconButton(
//iconSize: 45.0,
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: rating == (index + 1) ? 60 : 40,
// Theme.of(context).hintColor,
icon: Image.asset('assets/images/' + (index + 1).toString() + '.png')),
),
),
)
],
),
SizedBox(height: 12),
SizedBox(
height: 12,
),
],
), ),
), SizedBox(height: 12),
SizedBox(
height: 12,
),
],
), ),
), ),
bottomSheet: Container( ),
height: MediaQuery.of(context).size.height * 0.15, bottomSheet: Container(
width: double.infinity, color: Colors.white,
color: Colors.grey[200], padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Column( child: Row(
children: <Widget>[ mainAxisSize: MainAxisSize.min,
Container( children: [
width: MediaQuery.of(context).size.width * 0.9, Expanded(
child: SecondaryButton( child: DefaultButton(
onTap: () async { TranslationBase.of(context).later,
if (rating > 0) { () {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
color: Color(0xffEAEAEA),
textColor: Color(0xff2B353E),
),
),
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
rating <= 0
? null
: () {
model model
.sendAppointmentRate( .sendAppointmentRate(
rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note) rating,
widget.appointmentDetails.appointmentNo,
widget.appointmentDetails.projectID,
widget.appointmentDetails.doctorID,
widget.appointmentDetails.clinicID,
note)
.then( .then(
(value) => { (value) => {
model model
.sendDoctorRate( .sendDoctorRate(
widget.doctorRate, widget.doctorRate,
widget.appointmentDetails.appointmentNo, widget
.appointmentDetails.appointmentNo,
widget.appointmentDetails.projectID, widget.appointmentDetails.projectID,
widget.appointmentDetails.doctorID, widget.appointmentDetails.doctorID,
widget.appointmentDetails.clinicID, widget.appointmentDetails.clinicID,
note, note,
widget.appointmentDetails.appointmentDate, widget.appointmentDetails
.appointmentDate,
widget.appointmentDetails.doctorName, widget.appointmentDetails.doctorName,
widget.appointmentDetails.projectName, widget.appointmentDetails.projectName,
widget.appointmentDetails.clinicName) widget.appointmentDetails.clinicName)
@ -205,36 +302,12 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
}), }),
}, },
); );
} else { },
AppToast.showErrorToast(message: 'please rate the clinic'); color: Color(0xff359846),
} disabledColor: Colors.grey,
},
label: TranslationBase.of(context).submit,
disabled: (model.state == ViewState.Busy || rating == 0),
// loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
), ),
SizedBox( ),
height: 12, ],
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
child: Texts(
TranslationBase.of(context).later,
decoration: TextDecoration.underline,
color: HexColor('#151DFE'),
fontSize: 18,
),
)
],
),
), ),
), ),
), ),

@ -1,20 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
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/pages/rateAppointment/rate_appointment_clinic.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.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';
class RateAppointmentDoctor extends StatefulWidget { class RateAppointmentDoctor extends StatefulWidget {
@override @override
@ -30,214 +27,192 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AppointmentRateViewModel>( return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
body: Scaffold( appBarTitle: TranslationBase.of(context).rateDoctor,
backgroundColor: Colors.grey[200], body: SingleChildScrollView(
appBar: AppBar( child: Container(
elevation: 0, padding: EdgeInsets.all(12),
textTheme: TextTheme( child: Column(
headline6: crossAxisAlignment: CrossAxisAlignment.start,
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), children: <Widget>[
), SizedBox(
title: Text(TranslationBase.of(context).rate), height: 25, //5598
leading: Builder( ),
builder: (BuildContext context) { Text(
return IconButton( TranslationBase.of(context).lastVisit,
icon: Icon(Icons.menu), style: TextStyle(
color: Colors.white, fontSize: 16,
onPressed: () => Scaffold.of(context).openDrawer(), fontWeight: FontWeight.w600,
); color: Color(0xff2B353E),
}, letterSpacing: -0.64,
), height: 23 / 16),
centerTitle: true, ),
), SizedBox(
drawer: SafeArea(child: AppDrawer()), height: 25,
body: FractionallySizedBox( ),
widthFactor: 1, Container(
child: SingleChildScrollView( child: DoctorView(
child: Container( doctor: getDoctorObject(model),
padding: EdgeInsets.all(12), isLiveCareAppointment: false,
child: Column( isShowFlag: false,
children: <Widget>[ ),
SizedBox( ),
height: 25, //5598 SizedBox(
), height: 12,
Texts( ),
TranslationBase.of(context).lastVisit, Container(
bold: true, width: double.infinity,
color: Colors.black, child: Card(
), elevation: 0,
SizedBox( shape: cardRadius(10),
height: 25, child: Padding(
), padding: const EdgeInsets.all(12.0),
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
),
child: Column( child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: [
height: 8, Text(
), TranslationBase.of(context).tapTitle,
LargeAvatar( style: TextStyle(
name: model.appointmentDetails.doctorName, fontSize: 16,
url: model.appointmentDetails.doctorImageURL, fontWeight: FontWeight.w600,
width: 110, color: Color(0xff2B353E),
height: 110, letterSpacing: -0.64,
), height: 23 / 16),
SizedBox(
height: 22,
),
Texts(
TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName,
bold: true,
), ),
SizedBox( SizedBox(
height: 4, height: 12,
), ),
Texts( Row(
model.appointmentDetails.clinicName != null ? model.appointmentDetails.clinicName : "", mainAxisAlignment: MainAxisAlignment.center,
bold: true, children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child,
Animation<double> animation) {
return ScaleTransition(
child: child, scale: animation);
},
child: Container(
key: ValueKey<int>(rating),
child: IconButton(
iconSize: 45.0,
onPressed: () {
setState(() {
rating = index + 1;
});
},
color: rating >= (index + 1)
? Color.fromRGBO(255, 186, 0, 1.0)
: Colors.grey[400],
// Theme.of(context).hintColor,
icon: Icon(rating >= (index + 1)
? Icons.star
: Icons.star)),
),
),
)
],
), ),
SizedBox(
height: 8,
)
], ],
), ),
), ),
SizedBox( ),
height: 12, ),
), SizedBox(
Center( height: 12,
child: Texts( ),
TranslationBase.of(context).tapTitle, Card(
textAlign: TextAlign.center, elevation: 0,
)), shape: cardRadius(10),
SizedBox( child: Padding(
height: 12, padding: EdgeInsets.all(8.0),
), child: TextField(
Row( maxLines: 5,
mainAxisAlignment: MainAxisAlignment.center, decoration: InputDecoration.collapsed(
children: <Widget>[ hintText: TranslationBase.of(context).notes,
...List.generate( hintStyle: TextStyle(
5, fontSize: 16,
(index) => AnimatedSwitcher( fontWeight: FontWeight.w600,
duration: Duration(milliseconds: 1000), color: Color(0xff2B353E),
switchInCurve: Curves.elasticOut, letterSpacing: -0.64,
switchOutCurve: Curves.elasticIn, height: 23 / 16)),
transitionBuilder: onChanged: (value) {
(Widget child, Animation<double> animation) { setState(() {
return ScaleTransition( note = value;
child: child, scale: animation); });
}, },
child: Container( ))),
key: ValueKey<int>(rating), ],
child: IconButton( ),
iconSize: 45.0, ),
onPressed: () { ),
setState(() { bottomSheet: Container(
rating = index + 1; color: Colors.white,
}); padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
}, child: Row(
color: rating >= (index + 1) mainAxisSize: MainAxisSize.min,
? Color.fromRGBO(255, 186, 0, 1.0) children: [
: Colors.grey[400], Expanded(
// Theme.of(context).hintColor, child: DefaultButton(
icon: Icon(rating >= (index + 1) TranslationBase.of(context).later,
? EvaIcons.star () {
: EvaIcons.star)), Navigator.pushReplacement(
), context,
), FadePage(
) page: LandingPage(),
],
),
SizedBox(
height: 12,
),
Form(
key: formKey,
child: TextFields(
hintText: TranslationBase.of(context).notes,
minLines: 4,
maxLines: 4,
// validator: (value) {
// if (value.isEmpty)
// return 'Please enter your note';
// else if (rating == 0) return 'Rating cannot be \"0\"';
// return null;
// },
onChanged: (value) {
setState(() {
note = value;
});
},
), ),
), );
SizedBox( },
height: 12, color: Color(0xffEAEAEA),
), textColor: Color(0xff2B353E),
Container( ),
width: double.infinity, ),
child: Column( SizedBox(width: 10),
children: <Widget>[ Expanded(
Container( child: DefaultButton(
width: MediaQuery.of(context).size.width * 0.9, TranslationBase.of(context).next,
child: SecondaryButton( rating <= 0
onTap: () async { ? null
final form = formKey.currentState; : () {
if (form.validate() && rating>0 ) { Navigator.push(
form.save(); context,
Navigator.push( FadePage(
context, page: RateAppointmentClinic(
FadePage( appointmentDetails: model.appointmentDetails,
page: RateAppointmentClinic( doctorNote: note,
appointmentDetails: doctorRate: rating,
model.appointmentDetails, ),
doctorNote: note,
doctorRate: rating,
),
),
);
}
},
label: TranslationBase.of(context).next,
disabled: (model.state == ViewState.BusyLocal || rating==0),
loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
),
SizedBox(
height: 12,
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
child: Texts(
TranslationBase.of(context).later,
decoration: TextDecoration.underline,
color: HexColor('#151DFE'),
fontSize: 18,
), ),
) );
], },
), // iconData: Icons.notifications_active,
) color: Color(0xff359846),
], disabledColor: Colors.grey,
), ),
), ),
), ],
), ),
), ),
), ),
); );
} }
DoctorList getDoctorObject(AppointmentRateViewModel model) {
DoctorList doctor = new DoctorList();
doctor.name = model.appointmentDetails.doctorName;
doctor.doctorImageURL = model.appointmentDetails.doctorImageURL;
doctor.clinicName = model.appointmentDetails.clinicName;
doctor.projectName = model.appointmentDetails.projectName;
doctor.actualDoctorRate = 5;
return doctor;
}
} }

@ -2322,6 +2322,10 @@ class TranslationBase {
String get insuredPatientReferral => localizedValues["insuredPatient"][locale.languageCode]; String get insuredPatientReferral => localizedValues["insuredPatient"][locale.languageCode];
String get rateDoctor => localizedValues["rateDoctor"][locale.languageCode];
String get rateAppointment => localizedValues["rateAppointment"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save