From ef4a57223ca8df6adf1ee1e3c27e48d0d524d7ed Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 2 Sep 2020 14:19:14 +0300 Subject: [PATCH] fix DoctorView.dart UI issues --- lib/config/localized_values.dart | 6 +- lib/core/service/client/base_app_client.dart | 4 +- .../service/medical/my_doctor_service.dart | 12 +- .../medical/my_doctor_view_model.dart | 6 +- .../Appointments/DoctorListResponse.dart | 91 +++--- .../BookAppointment/widgets/DoctorView.dart | 130 ++++----- lib/pages/MyAppointments/MyAppointments.dart | 8 +- lib/pages/landing/home_page.dart | 4 +- .../medical/doctor/doctor_home_page.dart | 48 +++- .../medical/doctor/doctor_profile_page.dart | 258 +++++++++--------- lib/uitl/translations_delegate_base.dart | 6 + 11 files changed, 320 insertions(+), 253 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6d2cff69..3291870d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -373,5 +373,9 @@ const Map> localizedValues = { "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, + "MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, + "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, + "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, + "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f45fe22b..aa48c49d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -36,9 +36,7 @@ class BaseAppClient { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['VersionID'] = body.containsKey('VersionID') - ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID - : VERSION_ID; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['IPAdress'] = IP_ADDRESS; diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index 349d7ace..d688c7e7 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -6,10 +6,12 @@ import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_app import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; class MyDoctorService extends BaseService { List patientDoctorAppointmentList = List(); DoctorProfile doctorProfile; + DoctorList doctorList; DoctorRating doctorRating = DoctorRating(); RequestPatientDoctorAppointment patientDoctorAppointmentRequest = @@ -58,7 +60,6 @@ class MyDoctorService extends BaseService { } RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile( - doctorID: 2477, license: true, isRegistered: true, projectID: 12, @@ -79,11 +80,18 @@ class MyDoctorService extends BaseService { ///GET DOCTOR PROFILE _requestDoctorProfile.doctorID = doctorId; _requestDoctorProfile.clinicID = clinicID; - _requestDoctorProfile.patientID = projectID; + _requestDoctorProfile.projectID = projectID; hasError = false; await baseAppClient.post(GET_DOCTOR_PROFILE, onSuccess: (dynamic response, int statusCode) { doctorProfile = DoctorProfile.fromJson(response['DoctorProfileList'][0]); + doctorList = DoctorList.fromJson(response['DoctorProfileList'][0]); + doctorList.clinicName = doctorProfile.clinicDescription; + doctorList.doctorTitle = doctorProfile.doctorTitleForProfile; + doctorList.name = doctorProfile.doctorName; + doctorList.projectName = doctorProfile.projectName; + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart index e04f9bdd..f1db7804 100644 --- a/lib/core/viewModels/medical/my_doctor_view_model.dart +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -22,6 +23,9 @@ class MyDoctorViewModel extends BaseViewModel { ? _patientDoctorAppointmentListClinic : _patientDoctorAppointmentListHospital; + DoctorList get doctorList=> _myDoctorService.doctorList; + + DoctorProfile get doctorProfile => _myDoctorService.doctorProfile; DoctorRating get doctorRating => _myDoctorService.doctorRating; @@ -83,7 +87,7 @@ class MyDoctorViewModel extends BaseViewModel { notifyListeners(); } - void getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { + Future getDoctorProfileAndRating({int doctorId,int clinicID,int projectID }) async { setState(ViewState.Busy); await _myDoctorService.getDoctorProfileAndRating(doctorId: doctorId,clinicID: clinicID,projectID: projectID); if (_myDoctorService.hasError) { diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 2f4ee2a0..1ef6ee72 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -1,3 +1,5 @@ +import 'package:intl/intl.dart'; + class DoctorList { int clinicID; String clinicName; @@ -41,44 +43,44 @@ class DoctorList { DoctorList( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -118,7 +120,8 @@ class DoctorList { rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - speciality = json['Speciality'].cast(); + if (json.containsKey('Speciality')) + speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } @@ -166,3 +169,13 @@ class DoctorList { return data; } } + +class DoctorListAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + DoctorListAppointmentList( + {this.filterName, DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 3d69a93d..4cdc3977 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -9,7 +9,7 @@ import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { - DoctorList doctor; + final DoctorList doctor; DoctorView({@required this.doctor}); @@ -33,69 +33,77 @@ class DoctorView extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network(this.doctor.doctorImageURL, - fit: BoxFit.fill, height: 60.0, width: 60.0), + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network(this.doctor.doctorImageURL, + fit: BoxFit.fill, height: 60.0, width: 60.0), + ), ), - Container( - width: MediaQuery.of(context).size.width * 0.6, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(this.doctor.doctorTitle + " " + this.doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.clinicName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.projectName, - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(this.doctor.speciality).trim(), + Expanded( + flex: 4, + child: Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if(doctor.doctorTitle!=null) + Text(this.doctor.doctorTitle + " " + this.doctor.name, style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + color: Colors.grey[700], letterSpacing: 1.0)), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: - this.doctor.actualDoctorRate.toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - Container( - child: Image.network(this.doctor.nationalityFlagURL, - width: 25.0, height: 25.0), - ), - ], - ), - ], + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.clinicName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.projectName, + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + if(doctor.speciality!=null) + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: + this.doctor.actualDoctorRate.toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + Container( + child: Image.network(this.doctor.nationalityFlagURL, + width: 25.0, height: 25.0), + ), + ], + ), + ], + ), ), ), ], diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 63034373..af4c47c0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -36,7 +36,7 @@ class _MyAppointmentsState extends State @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "My Appointments", + appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, body: Container( child: Column(children: [ @@ -158,7 +158,7 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", + child: Text(TranslationBase.of(context).noBookedAppointments, style: TextStyle( fontSize: 16.0, )), @@ -192,7 +192,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Confirmed Appointments", + child: Text(TranslationBase.of(context).noConfirmedAppointments , style: TextStyle( fontSize: 16.0, )), @@ -225,7 +225,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Arrived Appointments", + child: Text(TranslationBase.of(context).noArrivedAppointments, style: TextStyle( fontSize: 16.0, )), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 06a2f9ca..5e5c5971 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -154,8 +154,8 @@ class _HomePageState extends State { ), Align( alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, + ? Alignment.bottomRight + : Alignment.bottomLeft, child: InkWell( onTap: () { widget.goToMyProfile(); diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 4cce1dc8..075565e0 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_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/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; @@ -75,16 +77,40 @@ class DoctorHomePage extends StatelessWidget { children: model.patientDoctorAppointmentList[index] .patientDoctorAppointmentList .map((doctor) { - return InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorProfilePage( - patientDoctorAppointment: doctor, - ), - ), - ); + DoctorList doctorList = DoctorList( + projectID: doctor.projectID, + setupID: doctor.setupID, + clinicID: doctor.clinicID, + projectName: doctor.projectName, + clinicName: doctor.clinicName, + actualDoctorRate: doctor.actualDoctorRate, + doctorID: doctor.doctorID, + doctorRate: doctor.doctorRate, + gender: doctor.gender, + doctorTitle: doctor.doctorTitle, + name: doctor.doctorName, + doctorImageURL: doctor.doctorImageURL, + nationalityFlagURL:doctor.nationalityFlagURL + ); + return DoctorView(doctor: doctorList,);/* InkWell( + onTap: () async { + model + .getDoctorProfileAndRating( + doctorId: doctor.doctorID, + clinicID: doctor.clinicID, + projectID: doctor.projectID) + .then((value) { + var asd=""; + Navigator.push( + context, + FadePage( + page: DoctorView(doctor: model.doctorList,), + ), + ); + }).catchError((e){ + var asd=""; + + }); }, child: DoctorCard( name: doctor.doctorName, @@ -93,7 +119,7 @@ class DoctorHomePage extends StatelessWidget { subName: DateUtil.getMonthDayYearDateFormatted( doctor.appointmentDate), ), - ); + )*/; }).toList(), )), ) diff --git a/lib/pages/medical/doctor/doctor_profile_page.dart b/lib/pages/medical/doctor/doctor_profile_page.dart index 2b19ba3d..7588205c 100644 --- a/lib/pages/medical/doctor/doctor_profile_page.dart +++ b/lib/pages/medical/doctor/doctor_profile_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -35,149 +37,147 @@ class _DoctorProfilePageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDoctorProfileAndRating( - doctorId: widget.patientDoctorAppointment.doctorID, - clinicID: widget.patientDoctorAppointment.clinicID, - projectID: widget.patientDoctorAppointment.projectID), - builder: (context, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'Doctor Profile', - baseViewModel: model, - body: SingleChildScrollView( + /* onModelReady: (model) => model.getDoctorProfileAndRating( + doctorId: widget.patientDoctorAppointment.doctorID, + clinicID: widget.patientDoctorAppointment.clinicID, + projectID: widget.patientDoctorAppointment.projectID),*/ + builder: (context, model, widget) => DoctorView(doctor: model.doctorList,)/*AppScaffold( + isShowAppBar: true, + appBarTitle: 'Doctor Profile', + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + margin: EdgeInsets.only(top: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - margin: EdgeInsets.only(top: 20.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.calendar_view_day, - size: 25, - color: Colors.white, - )), - ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - patientDoctorAppointment.doctorImageURL, - fit: BoxFit.fill, - height: 120.0, - width: 120.0), - ), - Container( - margin: EdgeInsets.all(5), - width: 50, - height: 50, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors.grey), - child: Icon( - Icons.format_list_bulleted, - size: 25, - color: Colors.white, - )), - ], - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.calendar_view_day, + size: 25, + color: Colors.white, + )), + ClipRRect( + borderRadius: BorderRadius.circular(100.0), + child: Image.network( + patientDoctorAppointment.doctorImageURL, + fit: BoxFit.fill, + height: 120.0, + width: 120.0), ), Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.doctorName, - style: TextStyle( - fontSize: 20.0, - color: Colors.grey[900], - letterSpacing: 1.0)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text(patientDoctorAppointment.clinicName, - 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: - model.doctorRating.doctorRate?.toDouble() ?? - 0.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( - "(${model.doctorRating.patientNumber ?? 0} 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( - indicatorColor: Colors.red[800], - indicatorWeight: 3.0, - tabs: [ - Tab( - child: Text('Doctor Information', - 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: BouncingScrollPhysics(), - children: [ - DoctorInformation( - doctorProfile: model.doctorProfile, - ), - Container() - ], - controller: _tabController, - ), + margin: EdgeInsets.all(5), + width: 50, + height: 50, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.grey), + child: Icon( + Icons.format_list_bulleted, + size: 25, + color: Colors.white, + )), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.doctorName, + style: TextStyle( + fontSize: 20.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(patientDoctorAppointment.clinicName, + 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: + model.doctorRating.doctorRate?.toDouble() ?? 0.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( + "(${model.doctorRating.patientNumber ?? 0} 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( + indicatorColor: Colors.red[800], + indicatorWeight: 3.0, + tabs: [ + Tab( + child: Text('Doctor Information', + 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: BouncingScrollPhysics(), + children: [ + DoctorInformation( + doctorProfile: model.doctorProfile, ), + Container(), +// DocAvailableAppointments(doctor: model.doctorList,) ], + controller: _tabController, ), ), ], ), ), - )); + ], + ), + ), + )*/, + ); } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 43056cfb..5b9f0fc7 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -450,6 +450,12 @@ class TranslationBase { String get logs => localizedValues['logs'][locale.languageCode]; String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate {