From a0173c5b4d89900dc7091d2749f2d26effbac0f4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 16 Jul 2020 17:29:28 +0300 Subject: [PATCH] Appointment Details page, ToDo List Page implemented --- assets/json/bookedAllowCheckInButtons.json | 44 +++ assets/json/bookedButtons.json | 38 +++ lib/config/localized_values.dart | 9 + lib/models/Appointments/FreeSlot.dart | 12 + .../Appointments/appoDetailsButtons.dart | 24 ++ lib/pages/BookAppointment/BookSuccess.dart | 15 +- lib/pages/BookAppointment/BookingOptions.dart | 2 +- .../components/DocAvailableAppointments.dart | 2 +- .../BookAppointment/widgets/CardCommon.dart | 1 + .../MyAppointments/AppointmentDetails.dart | 139 +++++++++ .../Components/AppointmentActions.dart | 272 ++++++++++++++++++ .../models/AppointmentModel.dart | 84 ++++++ .../models/AppointmentType.dart | 40 +++ .../MyAppointments/models/BookedButtons.dart | 60 ++++ lib/pages/ToDoList/ToDo.dart | 31 ++ lib/pages/ToDoList/widgets/upcomingCard.dart | 181 ++++++++++++ lib/uitl/translations_delegate_base.dart | 18 ++ .../bottom_navigation/bottom_nav_bar.dart | 19 +- 18 files changed, 976 insertions(+), 15 deletions(-) create mode 100644 assets/json/bookedAllowCheckInButtons.json create mode 100644 assets/json/bookedButtons.json create mode 100644 lib/models/Appointments/FreeSlot.dart create mode 100644 lib/models/Appointments/appoDetailsButtons.dart create mode 100644 lib/pages/MyAppointments/AppointmentDetails.dart create mode 100644 lib/pages/MyAppointments/Components/AppointmentActions.dart create mode 100644 lib/pages/MyAppointments/models/AppointmentModel.dart create mode 100644 lib/pages/MyAppointments/models/AppointmentType.dart create mode 100644 lib/pages/MyAppointments/models/BookedButtons.dart create mode 100644 lib/pages/ToDoList/ToDo.dart create mode 100644 lib/pages/ToDoList/widgets/upcomingCard.dart diff --git a/assets/json/bookedAllowCheckInButtons.json b/assets/json/bookedAllowCheckInButtons.json new file mode 100644 index 00000000..e969da5a --- /dev/null +++ b/assets/json/bookedAllowCheckInButtons.json @@ -0,0 +1,44 @@ +[ + { + "title": "confirm", + "subtitle": "appointment", + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": "reschedule", + "subtitle": "appointment", + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": "cancel", + "subtitle": "appointment", + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": "raise", + "subtitle": "complaint", + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "add", + "subtitle": "reminder", + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": "hospital", + "subtitle": "locations", + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, + { + "title": "online", + "subtitle": "payment", + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList(31)" + } +] \ No newline at end of file diff --git a/assets/json/bookedButtons.json b/assets/json/bookedButtons.json new file mode 100644 index 00000000..e34718e2 --- /dev/null +++ b/assets/json/bookedButtons.json @@ -0,0 +1,38 @@ +[ + { + "title": "confirm", + "subtitle": "appointment", + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, + { + "title": "reschedule", + "subtitle": "appointment", + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": "cancel", + "subtitle": "appointment", + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": "raise", + "subtitle": "complaint", + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "add", + "subtitle": "reminder", + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": "hospital", + "subtitle": "locations", + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + } +] \ No newline at end of file diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ba148703..3fc65bf2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -31,6 +31,15 @@ const Map> localizedValues = { 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, 'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, + 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, + 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, + 'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'}, + 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, + 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, + 'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, + 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, + 'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, + 'appoActions': {'en': 'Appointment Actions', 'ar': 'إجراءات الموعد'}, }; diff --git a/lib/models/Appointments/FreeSlot.dart b/lib/models/Appointments/FreeSlot.dart new file mode 100644 index 00000000..46692982 --- /dev/null +++ b/lib/models/Appointments/FreeSlot.dart @@ -0,0 +1,12 @@ +class FreeSlot { + List event; + DateTime slot; + + + FreeSlot(this.slot, this.event); + + @override + String toString() { + return '{ ${this.slot}, ${this.event} }'; + } +} \ No newline at end of file diff --git a/lib/models/Appointments/appoDetailsButtons.dart b/lib/models/Appointments/appoDetailsButtons.dart new file mode 100644 index 00000000..adce8b93 --- /dev/null +++ b/lib/models/Appointments/appoDetailsButtons.dart @@ -0,0 +1,24 @@ +class AppoDetailsButton { + String title; + String subtitle; + String icon; + String caller; + + AppoDetailsButton({this.title, this.subtitle, this.icon, this.caller}); + + AppoDetailsButton.fromJson(Map json) { + title = json['title']; + subtitle = json['subtitle']; + icon = json['icon']; + caller = json['caller']; + } + + Map toJson() { + final Map data = new Map(); + data['title'] = this.title; + data['subtitle'] = this.subtitle; + data['icon'] = this.icon; + data['caller'] = this.caller; + return data; + } +} diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index b485ec4d..460d4fff 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -1,7 +1,6 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import '../landing_page.dart'; - class BookSuccess extends StatefulWidget { @override _BookSucceState createState() => _BookSucceState(); @@ -32,7 +31,7 @@ class _BookSucceState extends State { Container( alignment: Alignment.center, margin: EdgeInsets.only(top: 40.0), - child: Text("Book Success", + child: Text(TranslationBase.of(context).bookSuccess, style: TextStyle( color: Colors.white, fontSize: 18.0, @@ -97,9 +96,9 @@ class _BookSucceState extends State { BorderSide(width: 0.5, color: Colors.white)), children: [ TableRow(children: [ - TableCell(child: _getNormalText("Patient Share")), + TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)), TableCell( - child: _getNormalText("Patient Share With Tax")), + child: _getNormalText(TranslationBase.of(context).patientShareWithTax)), ]), TableRow(children: [ TableCell(child: _getHeadingText("SR 35.7")), @@ -118,7 +117,7 @@ class _BookSucceState extends State { Container( margin: EdgeInsets.only(top: 30.0, bottom: 40.0), alignment: Alignment.center, - child: Text("Confirm Appointment", + child: Text(TranslationBase.of(context).confirmAppo, style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)), ), Flex( @@ -193,7 +192,7 @@ class _BookSucceState extends State { onPressed: () { }, child: - Text('CONFIRM', style: TextStyle(fontSize: 18.0)), + Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), ), ButtonTheme( @@ -211,7 +210,7 @@ class _BookSucceState extends State { navigateToHome(context); }, child: - Text('CONFIRM LATER', style: TextStyle(fontSize: 18.0)), + Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), ), ], diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index c6cc759b..57442d6c 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -7,7 +7,7 @@ class BookingOptions extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)), + appBar: AppBar(title: Text(TranslationBase.of(context).bookAppo)) , body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), child: Column( diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 0a732229..851b6615 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:diplomaticquarterapp/models/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:flutter/material.dart'; import 'package:table_calendar/table_calendar.dart'; diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index 4a1a5070..2f05fa91 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -11,6 +11,7 @@ class CardCommon extends StatelessWidget { @override Widget build(BuildContext context) { + return GestureDetector( onTap: () { navigateToSearch(context); diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart new file mode 100644 index 00000000..ffb5f6be --- /dev/null +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -0,0 +1,139 @@ +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:rating_bar/rating_bar.dart'; +import 'Components/AppointmentActions.dart'; + + +class AppointmentDetails extends StatefulWidget { + @override + _AppointmentDetailsState createState() => _AppointmentDetailsState(); +} + +class _AppointmentDetailsState extends State with SingleTickerProviderStateMixin { + + TabController _tabController; + bool showFooterButton = false; + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Eyad Ismail Abu-Jayab"), + ), + body: Container( + color: new Color(0xFFf6f6f6), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.center, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + "https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png", + fit: BoxFit.fill, + height: 120.0, + width: 120.0), + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text("Dr. EYAD ISMAIL ABU-JAYAD", + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text("INTERNAL MEDICINE CLINIC", + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: 4.0, + 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: 5.0), + alignment: Alignment.center, + child: Text("(2322 Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + TabBar( + onTap: (index) { + setState(() { + index == 1 + ? showFooterButton = true + : showFooterButton = false; + print(showFooterButton); + }); + }, + tabs: [ + Tab( + child: Text(TranslationBase.of(context).appoActions, + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) + ], + controller: _tabController, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.8, + child: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [AppointmentActions(), DocAvailableAppointments()], + controller: _tabController, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/MyAppointments/Components/AppointmentActions.dart b/lib/pages/MyAppointments/Components/AppointmentActions.dart new file mode 100644 index 00000000..16f50800 --- /dev/null +++ b/lib/pages/MyAppointments/Components/AppointmentActions.dart @@ -0,0 +1,272 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentModel.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class AppointmentActions extends StatefulWidget { + @override + _AppointmentActionsState createState() => _AppointmentActionsState(); +} + +class _AppointmentActionsState extends State { + List appoButtonsList = []; + var appointment = new AppointmentModel(); + + @override + void initState() { + appointment.PatientStatusType = 0; + appointment.IsOnlineCheckedIN = true; + + _getAppointmentActionButtons(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; + final double itemWidth = size.width / 2; + + return Container( + margin: EdgeInsets.all(5.0), + child: CustomScrollView( + primary: false, + physics: NeverScrollableScrollPhysics(), + slivers: [ + SliverPadding( + padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), + sliver: SliverGrid.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemHeight), + children: appoButtonsList + .map((e) => GestureDetector( + onTap: () { + _handleButtonClicks(e); + }, + child: Container( + height: 100.0, + margin: EdgeInsets.all(9.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0) + ], + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(e.title, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: + EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(e.subtitle, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: + EdgeInsets.fromLTRB(0.0, 20.0, 10.0, 8.0), + child: Image.asset(e.icon, + width: 40.0, height: 40.0), + ), + ], + ), + ), + )) + .toList(), + ), + ), + ], + ), + ); + } + + _handleButtonClicks(AppoDetailsButton) { + print(AppoDetailsButton.caller); + } + + _getAppointmentActionButtons() { + if (appointment != null) { + if (isConfirmed()) { + if (appointment.IsOnlineCheckedIN) { + _getConfirmedCheckInAppoActionsList(); + } else { + _getConfirmedAppoActionsList(); + } + } else { + print("isConfirmed Null"); + } + if (isBooked()) { + if (appointment.IsOnlineCheckedIN) { + _getBookedCheckInAppoActionsList(); + } else { + _getBookedAppoActionsList(); + } + } else { + print("isBooked Null"); + } + if (isArrived()) { + if (appointment.ClinicID == 17) { + _getArrivedInvoiceAppoActionsList(); + } else { + _getArrivedAppoActionsList(); + } + } else { + print("isArrived Null"); + } + } else { + print("Appo Null"); + } + } + + bool isConfirmed() { + return AppointmentType.isConfirmed(this.appointment); + } + + bool isArrived() { + return AppointmentType.isArrived(this.appointment); + } + + bool isCheckedIn() { + return this.appointment.IsOnlineCheckedIN; + } + + bool isBooked() { + return AppointmentType.isBooked(this.appointment); + } + + Future> _getBookedAppoActionsList() async { + print("_getBookedAppoActionsList"); + var bookButtonsJson; + List buttonsList = []; + String data = await DefaultAssetBundle.of(context) + .loadString("assets/json/bookedButtons.json"); + bookButtonsJson = json.decode(data); + for (var i = 0; i < bookButtonsJson.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookButtonsJson[i]['title'], + subtitle: bookButtonsJson[i]['subtitle'], + icon: bookButtonsJson[i]['icon'], + caller: bookButtonsJson[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getBookedCheckInAppoActionsList() async { +// BookedButtons.getContext(context); + print("_getBookedCheckInAppoActionsList"); + List buttonsList = []; + for (var i = 0; i < BookedButtons.buttons.length; i++) { + buttonsList.add(AppoDetailsButton( + title: BookedButtons.buttons[i]['title'], + subtitle: BookedButtons.buttons[i]['subtitle'], + icon: BookedButtons.buttons[i]['icon'], + caller: BookedButtons.buttons[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getConfirmedAppoActionsList() async { + var bookButtonsJson; + List buttonsList = []; + String data = await DefaultAssetBundle.of(context) + .loadString("assets/json/bookedButtons.json"); + bookButtonsJson = json.decode(data); + for (var i = 0; i < bookButtonsJson.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookButtonsJson[i]['title'], + subtitle: bookButtonsJson[i]['subtitle'], + icon: bookButtonsJson[i]['icon'], + caller: bookButtonsJson[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getConfirmedCheckInAppoActionsList() async { + var bookButtonsJson; + List buttonsList = []; + String data = await DefaultAssetBundle.of(context) + .loadString("assets/json/bookedButtons.json"); + bookButtonsJson = json.decode(data); + for (var i = 0; i < bookButtonsJson.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookButtonsJson[i]['title'], + subtitle: bookButtonsJson[i]['subtitle'], + icon: bookButtonsJson[i]['icon'], + caller: bookButtonsJson[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getArrivedAppoActionsList() async { + var bookButtonsJson; + List buttonsList = []; + String data = await DefaultAssetBundle.of(context) + .loadString("assets/json/bookedButtons.json"); + bookButtonsJson = json.decode(data); + for (var i = 0; i < bookButtonsJson.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookButtonsJson[i]['title'], + subtitle: bookButtonsJson[i]['subtitle'], + icon: bookButtonsJson[i]['icon'], + caller: bookButtonsJson[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } + + Future> _getArrivedInvoiceAppoActionsList() async { + var bookButtonsJson; + List buttonsList = []; + String data = await DefaultAssetBundle.of(context) + .loadString("assets/json/bookedButtons.json"); + bookButtonsJson = json.decode(data); + for (var i = 0; i < bookButtonsJson.length; i++) { + buttonsList.add(AppoDetailsButton( + title: bookButtonsJson[i]['title'], + subtitle: bookButtonsJson[i]['subtitle'], + icon: bookButtonsJson[i]['icon'], + caller: bookButtonsJson[i]['caller'], + )); + } + setState(() { + appoButtonsList = buttonsList; + }); + } +} diff --git a/lib/pages/MyAppointments/models/AppointmentModel.dart b/lib/pages/MyAppointments/models/AppointmentModel.dart new file mode 100644 index 00000000..304ae7ed --- /dev/null +++ b/lib/pages/MyAppointments/models/AppointmentModel.dart @@ -0,0 +1,84 @@ +//Appointment Model to be used in all the appointment based pages & components + +class AppointmentModel { + + static var SHARED_DATA = 'appointment-model'; + static var PATIENT_DATA = 'patient-model'; + var DoctorSpeciality = []; + + var List_HIS_GetContactLensPerscription = []; + var List_HIS_GetGlassPerscription = []; + var SetupID; + var ProjectID; + var AppointmentNo; + var AppointmentDate; + var AppointmentDateN; + var AppointmentType; + var BookDate; + var PatientType; + var PatientID; + var ClinicID; + var DoctorID; + var EndDate; + var StartTime; + var EndTime; + var Status; + var VisitType; + var VisitFor; + var PatientStatusType; + var CompanyID; + var BookedBy; + var BookedOn; + var ConfirmedBy; + var ConfirmedOn; + var ArrivalChangedBy; + var ArrivedOn; + var EditedBy; + var EditedOn; + var DoctorName; + var DoctorNameN; + var StatusDesc; + var StatusDescN; + var VitalStatus; + var VitalSignAppointmentNo; + var ClinicName; + var ComplainExists; + var DoctorImageURL; + var DoctorNameObj; + var DoctorRate; + var DoctorTitle; + var Gender; + var GenderDescription; + var IsActiveDoctor; + var IsActiveDoctorProfile; + var IsExecludeDoctor; + var IsMedicalReportRequested; + var ProjectName; + var QR; + var SMSButtonVisable; + var DoctorRatingDetailsList; + var AvgDoctorRatingList; + var IsLiveCareAppointment; + var OriginalClinicID; + var OriginalProjectID; + var StrAppointmentDate; + /* + the check in parameters + */ + // if onlince checked in mean user paid the appointment + var IsOnlineCheckedIN; + + // if user is allowed to pay for the appointment + var ISAllowOnlineCheckedIN; + + var PatientShare; + var CompanyName; + var PatientTaxAmount; + var PatientShareWithTax; + var IsFollowup; + var IsDoctorAllowVedioCall; + + static String getAppointmentTransID(appo) { + return appo.ProjectID + '-' + appo.ClinicID + '-' + appo.AppointmentNo; + } +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/models/AppointmentType.dart b/lib/pages/MyAppointments/models/AppointmentType.dart new file mode 100644 index 00000000..2ac004f4 --- /dev/null +++ b/lib/pages/MyAppointments/models/AppointmentType.dart @@ -0,0 +1,40 @@ +class AppointmentType { + static var BOOKED = 0; + static const BOOKED_STR = 'booked'; + static var CONFIRMED = 42; + static const CONFIRMED_STR = 'confirmed'; + static var ARRIVED = 43; + static const ARRIVED_STR = 'arrived'; + + static bool isConfirmed(appo) { + return AppointmentType.isValid(appo) && + appo.PatientStatusType == AppointmentType.CONFIRMED; + } + + static bool isBooked(appo) { + return AppointmentType.isValid(appo) && + appo.PatientStatusType == AppointmentType.BOOKED; + } + + static bool isArrived(appo) { + return AppointmentType.isValid(appo) && + appo.PatientStatusType == AppointmentType.ARRIVED; + } + + static isValid(appo) { + return appo != null && appo.PatientStatusType != null; + } + + static int getType(typeName) { + switch (typeName) { + case AppointmentType.BOOKED_STR: + return AppointmentType.BOOKED; + case AppointmentType.ARRIVED_STR: + return AppointmentType.ARRIVED; + case AppointmentType.CONFIRMED_STR: + return AppointmentType.CONFIRMED; + default: + return AppointmentType.BOOKED; + } + } +} diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart new file mode 100644 index 00000000..a9f06cc8 --- /dev/null +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -0,0 +1,60 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class BookedButtons { + static var context; + + static var buttons = [ + { + "title": TranslationBase.of(context).confirm, + "subtitle": TranslationBase.of(context).appointment, + "icon": "assets/images/new-design/confirm_icon.png", + "caller": "confirmAppointment" + }, +// { +// "title": "confirm", +// "subtitle": "Appointment", +// "icon": "assets/images/new-design/confirm_icon.png", +// "caller": "confirmAppointment" +// }, + { + "title": "reschedule", + "subtitle": "appointment", + "icon": "assets/images/new-design/reschedule_icon.png", + "caller": "openReschedule" + }, + { + "title": "cancel", + "subtitle": "appointment", + "icon": "assets/images/new-design/cancel_icon.png", + "caller": "onCancelAppointment" + }, + { + "title": "raise", + "subtitle": "complaint", + "icon": "assets/images/new-design/Complaint_icon.png", + "caller": "insertComplaint" + }, + { + "title": "add", + "subtitle": "reminder", + "icon": "assets/images/new-design/reminder_icon.png", + "caller": "addReminder" + }, + { + "title": "hospital", + "subtitle": "locations", + "icon": "assets/images/new-design/location_icon.png", + "caller": "navigateToProject" + }, + { + "title": "online", + "subtitle": "payment", + "icon": "assets/images/new-design/check-in.png", + "caller": "goToTodoList(31)" + } + ]; + +// static getContext(context) { +// BookedButtons.context = context; +// } +} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart new file mode 100644 index 00000000..85ce348d --- /dev/null +++ b/lib/pages/ToDoList/ToDo.dart @@ -0,0 +1,31 @@ +import 'package:diplomaticquarterapp/pages/ToDoList/widgets/upcomingCard.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class ToDo extends StatefulWidget { + @override + _ToDoState createState() => _ToDoState(); +} + +class _ToDoState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(TranslationBase.of(context).todoList), + ), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + TodoListCard(), + TodoListCard(), + TodoListCard(), + TodoListCard(), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart new file mode 100644 index 00000000..d4358dc5 --- /dev/null +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -0,0 +1,181 @@ +import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; +import 'package:flutter/material.dart'; +import 'package:rating_bar/rating_bar.dart'; + +class TodoListCard extends StatefulWidget { + @override + _TodoListCardState createState() => _TodoListCardState(); +} + +class _TodoListCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Image.asset("assets/images/new-design/time_icon.png", + width: 20.0, height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 30.0), + child: Text("Monday, 31 August 2020 09:30", + style: TextStyle(fontSize: 12.0)), + ), + Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: EdgeInsets.only(left: 10.0, right: 10.0), + child: Text("Olaya Hospital", + style: TextStyle(fontSize: 12.0)), + ), + ], + ), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Divider( + color: Colors.grey[500], + ), + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + margin: EdgeInsets.only(top: 5.0), + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + "https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png", + fit: BoxFit.fill), + ), + ), + ), + Expanded( + flex: 3, + child: Container( + margin: + EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), + height: MediaQuery.of(context).size.height * 0.1, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Dr. EYAD ISMAIL ABU-JAYAD", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text("General Practioner", + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: 4.0, + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], + ), + ], + ), + ), + ), + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + "assets/images/new-design/confirm_button.png", + width: 50.0, + height: 50.0), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text("Confirm", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12.0)), + ) + ], + ), + ), + ) + ], + ), + Divider( + color: Colors.grey[500], + ), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + "Please confirm the appointment to avoid cancellation", + style: TextStyle( + fontSize: 12.0, color: Colors.grey[700])), + ), + ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails(context); + }, + child: Container( + child: Text("More Details", + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: Colors.red[600], + decoration: TextDecoration.underline)), + ), + ), + ) + ], + ) + ], + ), + ), + ), + ); + } + + Future navigateToAppointmentDetails(context) async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => AppointmentDetails())); + } + +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 92ec2fd5..056258c1 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -77,6 +77,24 @@ class TranslationBase { String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode]; String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; + + String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; + + String get patientShare => localizedValues['patientShare'][locale.languageCode]; + + String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; + + String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; + + String get confirm => localizedValues['confirm'][locale.languageCode]; + + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; + + String get todoList => localizedValues['todoList'][locale.languageCode]; + + String get appoActions => localizedValues['appoActions'][locale.languageCode]; + + String get appointment => localizedValues['appointment'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 7fb53d63..737ad603 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; @@ -22,9 +23,12 @@ class _BottomNavBarState extends State { widget.changeIndex(index); setState(() { _index = index; - if(_index == 4) { - navigateToBookingOptions(context); - } + + // Navigate to Appointment Booking Flow + if (_index == 4) navigateToBookingOptions(context); + + // Navigate to upcoming list + if (_index == 3) navigateToToDoList(context); }); } @@ -71,7 +75,7 @@ class _BottomNavBarState extends State { // Added Calendar Icon to access book appointment flow BottomNavigationItem( - icon:EvaIcons.calendar, + icon: EvaIcons.calendar, activeIcon: EvaIcons.calendarOutline, changeIndex: _changeIndex, index: _index, @@ -80,7 +84,7 @@ class _BottomNavBarState extends State { ), BottomNavigationItem( - icon:EvaIcons.person, + icon: EvaIcons.person, activeIcon: EvaIcons.person, changeIndex: _changeIndex, index: _index, @@ -100,8 +104,13 @@ class _BottomNavBarState extends State { ), ); } + Future navigateToBookingOptions(context) async { Navigator.push( context, MaterialPageRoute(builder: (context) => BookingOptions())); } + + Future navigateToToDoList(context) async { + Navigator.push(context, MaterialPageRoute(builder: (context) => ToDo())); + } }