From b4bc99369f92086bed97e8f5ab672bdf66cfb541 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" Date: Mon, 13 Nov 2023 16:24:44 +0300 Subject: [PATCH] Changes into Rating Bar --- android/app/build.gradle | 2 +- lib/config/config.dart | 4 +- lib/main.dart | 5 +- .../health_calculator/doctor_list.dart | 17 +- lib/pages/BookAppointment/DoctorProfile.dart | 6 +- .../BookAppointment/widgets/DoctorView.dart | 8 +- .../MyAppointments/AppointmentDetails.dart | 7 +- .../widgets/AppointmentCardView.dart | 8 +- lib/pages/ToDoList/ToDo.dart | 52 +- lib/pages/ToDoList/widgets/upcomingCard.dart | 7 +- .../web_rtc/widgets/cam_view_widget.dart | 164 +-- lib/pages/final_products_page.dart | 100 +- lib/pages/landing/landing_page.dart | 2 +- lib/pages/medical/eye/EyeHomePage.dart | 7 +- .../medical/reports/report_list_widget.dart | 8 +- lib/pages/medical/reports/reports_page.dart | 8 +- lib/pages/offers_categorise_page.dart | 13 +- .../OfferAndPackageDetailPage.dart | 7 +- lib/pages/parent_categorise_page.dart | 15 +- lib/pages/pharmacies/my_reviews.dart | 141 ++- .../product-name-and-price.dart | 8 +- .../product-details/recommended_products.dart | 8 +- .../screens/product-details/reviews_info.dart | 19 +- .../pharmacies/widgets/ProductTileItem.dart | 7 +- .../widgets/home/PrescriptionsWidget.dart | 8 +- lib/pages/pharmacy/order/ProductReview.dart | 15 +- lib/pages/sub_categorise_page.dart | 12 +- .../webrtc/signaling.dart | 1018 ++++++++--------- .../webrtc/start_video_call.dart | 482 ++++---- lib/pages/webRTC/signaling_bkp.dart | 484 ++++---- lib/uitl/location_util.dart | 2 +- .../data_display/medical/doctor_card.dart | 8 +- lib/widgets/new_design/doctor_header.dart | 10 +- .../offers_packages/PackagesOfferCard.dart | 37 +- lib/widgets/pharmacy/product_tile.dart | 98 +- pubspec.yaml | 4 +- 36 files changed, 1419 insertions(+), 1382 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a1387dd3..44d134ee 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -79,7 +79,7 @@ android { } release { debuggable false - signingConfig signingConfigs.release + signingConfig signingConfigs.debug minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' diff --git a/lib/config/config.dart b/lib/config/config.dart index b390f319..2853317f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; + var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/main.dart b/lib/main.dart index 332dc8ff..19b230cb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -68,9 +68,10 @@ class _MyApp extends State { //0537503378 //1231755 - - //2466305493 + //0567184134 mobile + //2466305493 + // checkForUpdate() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart b/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart index 319deddc..04adcfc1 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/doctor_list.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -102,11 +103,21 @@ class DoctorList extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + ), + empty: Icon( + Icons.star, + color: CustomColors.accentColor, + ), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6fdbc954..e545f0fd 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -341,15 +341,15 @@ class _DoctorProfileState extends State with TickerProviderStateM ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index f64c44f3..94ae02ec 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -140,12 +141,13 @@ class DoctorView extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, itemPadding: EdgeInsets.symmetric(horizontal: 4.0), + unratedColor: Colors.grey[500], onRatingUpdate: (rating) { print(rating); }, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 7e4b0364..29ed7736 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -380,11 +380,12 @@ class _AppointmentDetailsState extends State with SingleTick itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index e03120f8..aec449b1 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -174,11 +175,12 @@ class _ApointmentCardState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 382a9691..baddbf93 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -54,7 +54,7 @@ class ToDo extends StatefulWidget { late MyInAppBrowser browser; bool isShowAppBar = true; - Function()? onBackClick; + Function()? onBackClick; bool isFromMyAppointments; AppoitmentAllHistoryResultList? appointment; @@ -67,7 +67,7 @@ class ToDo extends StatefulWidget { class _ToDoState extends State with SingleTickerProviderStateMixin { AppSharedPreferences sharedPref = AppSharedPreferences(); - List imagesInfo =[]; + List imagesInfo = []; late ToDoCountProviderModel toDoProvider; late CountdownTimerController controller; @@ -318,15 +318,15 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -858,7 +858,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { }); } dataLoaded = true; - if(widget.isFromMyAppointments) { + if (widget.isFromMyAppointments) { getPatientShare(context, widget.appointment!); } }); @@ -1025,23 +1025,29 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) { 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: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, onPaymentMethodSelected: (){}, isCashPatient: isCash,), - ), - ); - }, - transitionDuration: Duration(milliseconds: 500), - barrierDismissible: false, - barrierLabel: '', - context: context, - pageBuilder: (context, animation1, animation2) { return SizedBox();}) - .then((value) { + 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: PaymentDialog( + appo: appo, + patientShareResponse: patientShareResponse, + onPaymentMethodSelected: () {}, + isCashPatient: isCash, + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: false, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) { + return SizedBox(); + }).then((value) { if (value != null) { navigateToPaymentMethod(context, value as PatientShareResponse, appo); projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo); diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart index 6e010b9c..fa3e4a39 100644 --- a/lib/pages/ToDoList/widgets/upcomingCard.dart +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -119,11 +119,12 @@ class _TodoListCardState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart index 10dc8523..d9d030a7 100644 --- a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart +++ b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart @@ -1,82 +1,82 @@ -import 'dart:async'; -import 'dart:core'; - -import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -import 'draggable_cam.dart'; - -class CamViewWidget extends StatefulWidget { - RTCVideoRenderer? localRenderer; - RTCVideoRenderer? remoteRenderer; - MediaStream? localStream; - BoxConstraints? constraints; - StreamController? onButtonBarVisibleStreamController; - StreamController? onButtonBarHeightStreamController; - - CamViewWidget({this.localRenderer, this.remoteRenderer, this.constraints, this.onButtonBarVisibleStreamController, this.onButtonBarHeightStreamController}); - - @override - _CamViewWidgetState createState() => _CamViewWidgetState(); -} - -class _CamViewWidgetState extends State { - @override - void initState() { - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - height: double.infinity, - child: Stack( - children: [ - FractionallySizedBox( - heightFactor: 1, widthFactor: 1, - child: Container( - color: Colors.black87, - child: RTCVideoView(widget.remoteRenderer!, mirror: true,filterQuality: FilterQuality.medium,), - ), - ), - - if(widget.remoteRenderer!.srcObject == null) - Positioned.fill(child: _buildNoiseBox()), - - Positioned.fill( - child: RTCVideoView(widget.remoteRenderer!) - ), - - DraggableCam( - key: Key('publisher'), - onButtonBarHeight: widget.onButtonBarHeightStreamController!.stream, - onButtonBarVisible: widget.onButtonBarVisibleStreamController!.stream, - availableScreenSize: widget.constraints!.biggest, - child: RTCVideoView(widget.localRenderer!) - ), - - if(widget.remoteRenderer!.srcObject == null) - Container( - margin: EdgeInsets.all(MediaQuery.of(context).size.width/8), - child: Text( - 'Waiting for another participant to connect to the call...', - key: Key('text-wait'), - textAlign: TextAlign.center, - style: TextStyle(color: Colors.white), - ) - ), - ], - ), - ); - } - - - Widget _buildNoiseBox() { - return NoiseBox( - density: NoiseBoxDensity.xHigh, - backgroundColor: Colors.grey.shade900, - ); - } -} +// import 'dart:async'; +// import 'dart:core'; +// +// import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// import 'draggable_cam.dart'; +// +// class CamViewWidget extends StatefulWidget { +// RTCVideoRenderer? localRenderer; +// RTCVideoRenderer? remoteRenderer; +// MediaStream? localStream; +// BoxConstraints? constraints; +// StreamController? onButtonBarVisibleStreamController; +// StreamController? onButtonBarHeightStreamController; +// +// CamViewWidget({this.localRenderer, this.remoteRenderer, this.constraints, this.onButtonBarVisibleStreamController, this.onButtonBarHeightStreamController}); +// +// @override +// _CamViewWidgetState createState() => _CamViewWidgetState(); +// } +// +// class _CamViewWidgetState extends State { +// @override +// void initState() { +// super.initState(); +// } +// +// @override +// Widget build(BuildContext context) { +// return Container( +// width: double.infinity, +// height: double.infinity, +// child: Stack( +// children: [ +// FractionallySizedBox( +// heightFactor: 1, widthFactor: 1, +// child: Container( +// color: Colors.black87, +// // child: RTCVideoView(widget.remoteRenderer!, mirror: true,filterQuality: FilterQuality.medium,), +// ), +// ), +// +// if(widget.remoteRenderer!.srcObject == null) +// Positioned.fill(child: _buildNoiseBox()), +// +// // Positioned.fill( +// // child: RTCVideoView(widget.remoteRenderer!) +// // ), +// +// // DraggableCam( +// // key: Key('publisher'), +// // onButtonBarHeight: widget.onButtonBarHeightStreamController!.stream, +// // onButtonBarVisible: widget.onButtonBarVisibleStreamController!.stream, +// // availableScreenSize: widget.constraints!.biggest, +// // child: RTCVideoView(widget.localRenderer!) +// // ), +// +// if(widget.remoteRenderer!.srcObject == null) +// Container( +// margin: EdgeInsets.all(MediaQuery.of(context).size.width/8), +// child: Text( +// 'Waiting for another participant to connect to the call...', +// key: Key('text-wait'), +// textAlign: TextAlign.center, +// style: TextStyle(color: Colors.white), +// ) +// ), +// ], +// ), +// ); +// } +// +// +// Widget _buildNoiseBox() { +// return NoiseBox( +// density: NoiseBoxDensity.xHigh, +// backgroundColor: Colors.grey.shade900, +// ); +// } +// } diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 9d53012c..4432cb1c 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ; +import 'package:diplomaticquarterapp/uitl/utils.dart' as utils; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -22,7 +22,6 @@ import 'package:provider/provider.dart'; import 'base/base_view.dart'; - dynamic languageID; class FinalProductsPage extends StatefulWidget { @@ -216,21 +215,19 @@ class _FinalProductsPageState extends State { Container( margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center, - child: (model.finalProducts[index].images != null && - model.finalProducts[index].images!.length > 0) - ? Image.network( - model.finalProducts[index].images![0].src!, - fit: BoxFit.cover, - height: 80, - width: 80, - - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: 80, - width: 80, - ), + child: (model.finalProducts[index].images != null && model.finalProducts[index].images!.length > 0) + ? Image.network( + model.finalProducts[index].images![0].src!, + fit: BoxFit.cover, + height: 80, + width: 80, + ) + : Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: 80, + width: 80, + ), // Image.network( // model.finalProducts[index].images.isNotEmpty // ? model.finalProducts[index].images[0].thumb @@ -245,12 +242,12 @@ class _FinalProductsPageState extends State { padding: EdgeInsets.all(4), decoration: BoxDecoration( color: Color(0xffb23838), - // borderRadius: BorderRadius.only(topLeft: Radius.circular(6) - // ), + // borderRadius: BorderRadius.only(topLeft: Radius.circular(6) + // ), ), child: model.finalProducts[index].rxMessage != null ? Texts( - projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, + projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, color: Colors.white, regular: true, fontSize: 10, @@ -284,7 +281,8 @@ class _FinalProductsPageState extends State { ), ), ), - Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name, + Texts( + projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name, // model.finalProducts[index].name, regular: true, fontSize: 12, @@ -305,7 +303,7 @@ class _FinalProductsPageState extends State { // ? (model.finalProducts[index].approvedRatingSum.toDouble() / model.finalProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - + RatingBar( itemSize: 20.0, allowHalfRating: true, @@ -313,15 +311,15 @@ class _FinalProductsPageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -330,7 +328,6 @@ class _FinalProductsPageState extends State { tapOnlyMode: false, ), - Texts( "(${model.finalProducts[index].approvedTotalReviews})", regular: true, @@ -409,21 +406,19 @@ class _FinalProductsPageState extends State { Container( margin: EdgeInsets.fromLTRB(0, 0, 0, 8), alignment: Alignment.center, - child:(model.finalProducts[index].images != null && - model.finalProducts[index].images!.length > 0) + child: (model.finalProducts[index].images != null && model.finalProducts[index].images!.length > 0) ? Image.network( - model.finalProducts[index].images![0].src!, - fit: BoxFit.cover, - height: 80, - width: 80, - - ) + model.finalProducts[index].images![0].src!, + fit: BoxFit.cover, + height: 80, + width: 80, + ) : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: 80, - width: 80, - ), + "assets/images/no_image.png", + fit: BoxFit.cover, + height: 80, + width: 80, + ), // Image.network( // model.finalProducts[index].images.isNotEmpty // ? model.finalProducts[index].images[0].thumb @@ -443,14 +438,14 @@ class _FinalProductsPageState extends State { color: Color(0xffb23838), //borderRadius: BorderRadius.only(topLeft: Radius.circular(5)), ), - child:model.finalProducts[index].rxMessage != null + child: model.finalProducts[index].rxMessage != null ? Texts( - projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, - color: Colors.white, - regular: true, - fontSize: 8, - fontWeight: FontWeight.w600, - ) + projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, + color: Colors.white, + regular: true, + fontSize: 8, + fontWeight: FontWeight.w600, + ) : Texts(""), // Texts( // model.finalProducts[index].rxMessage != null ? model.finalProducts[index].rxMessage : "", @@ -479,7 +474,8 @@ class _FinalProductsPageState extends State { ), Container( width: MediaQuery.of(context).size.width * 0.55, - child: Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name, + child: Texts( + projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name, // model.finalProducts[index].name, regular: true, fontSize: 13.2, @@ -510,15 +506,15 @@ class _FinalProductsPageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -527,8 +523,6 @@ class _FinalProductsPageState extends State { tapOnlyMode: false, ), - - Texts( "(${model.finalProducts[index].approvedTotalReviews})", regular: true, @@ -555,8 +549,6 @@ class _FinalProductsPageState extends State { GifLoaderDialogUtils.hideDialog(context); // Navigator.push(context, FadePage(page: CartOrderPage())); utils.Utils.navigateToCartPage(); - - } else { AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index a0792b3d..a14a3bf5 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -435,7 +435,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { String caller = callerId.split("*")[3]; String receiver = callerId.split("*")[4]; String host = callerId.split("*")[5]; - await Navigator.push(context, MaterialPageRoute(builder: (context) => StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host))); + // await Navigator.push(context, MaterialPageRoute(builder: (context) => StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host))); } getNotificationCount(token) async { diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index cf96ad21..428c41d2 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -238,11 +238,12 @@ class _EyeHomePageState extends State with SingleTickerProviderStat allowHalfRating: true, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index dc7a5343..a20bf42c 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -107,20 +107,20 @@ class ReportListWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ RatingBar( - initialRating:report.actualDoctorRate == null ? 0.0: report.actualDoctorRate!.toDouble(), + initialRating: report.actualDoctorRate == null ? 0.0 : report.actualDoctorRate!.toDouble(), itemSize: 16, ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 0f0513e7..6e1f5081 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model. import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -114,15 +115,15 @@ class MedicalReports extends StatelessWidget { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -130,7 +131,6 @@ class MedicalReports extends StatelessWidget { updateOnDrag: false, tapOnlyMode: false, ), - Icon(Icons.email, color: Color(0xff2B353E)) ], ), diff --git a/lib/pages/offers_categorise_page.dart b/lib/pages/offers_categorise_page.dart index d4e57a9a..572978b9 100644 --- a/lib/pages/offers_categorise_page.dart +++ b/lib/pages/offers_categorise_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/viewModels/offers_Categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; @@ -343,15 +344,15 @@ class _OffersCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -539,15 +540,15 @@ class _OffersCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, diff --git a/lib/pages/packages_offers/OfferAndPackageDetailPage.dart b/lib/pages/packages_offers/OfferAndPackageDetailPage.dart index ad63c7cd..14ddf937 100644 --- a/lib/pages/packages_offers/OfferAndPackageDetailPage.dart +++ b/lib/pages/packages_offers/OfferAndPackageDetailPage.dart @@ -110,11 +110,12 @@ class OfferAndPackagesDetailState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 1815436a..83196fab 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -734,15 +734,15 @@ class _ParentCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -890,16 +890,13 @@ class _ParentCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], - ), + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], - ), + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], - ), + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, unratedColor: Colors.grey[500], diff --git a/lib/pages/pharmacies/my_reviews.dart b/lib/pages/pharmacies/my_reviews.dart index 89f7181d..dd36141d 100644 --- a/lib/pages/pharmacies/my_reviews.dart +++ b/lib/pages/pharmacies/my_reviews.dart @@ -1,12 +1,12 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/review_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; - class MyReviewsPage extends StatefulWidget { @override _MyReviewsPageState createState() => _MyReviewsPageState(); @@ -139,39 +139,46 @@ reviewDetails(data, rate, myRate) { Container( margin: EdgeInsets.all(5), child: Align( - alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, - child: - RatingBar( - initialRating: rate, - direction: Axis.horizontal, - allowHalfRating: true, - itemCount: 5, - itemSize: 20, - ignoreGestures: true, - ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), - ), - tapOnlyMode: true, - itemPadding: EdgeInsets.symmetric(horizontal: 4.0), - onRatingUpdate: (rating) { - print(rating); - }, - ) - // RatingBar.readOnly( - // initialRating: rate, - // size: 15.0, - // filledColor: Colors.yellow[700], - // emptyColor: Colors.grey[500], - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: Icons.star, - // ), - + alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, + child: RatingBar( + initialRating: rate, + direction: Axis.horizontal, + allowHalfRating: true, + itemCount: 5, + itemSize: 20, + ignoreGestures: true, + ratingWidget: RatingWidget( + full: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + ), + empty: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + ), + tapOnlyMode: true, + itemPadding: EdgeInsets.symmetric(horizontal: 4.0), + onRatingUpdate: (rating) { + print(rating); + }, + ) + // RatingBar.readOnly( + // initialRating: rate, + // size: 15.0, + // filledColor: Colors.yellow[700], + // emptyColor: Colors.grey[500], + // isHalfAllowed: true, + // halfFilledIcon: Icons.star_half, + // filledIcon: Icons.star, + // emptyIcon: Icons.star, + // ), - ), + ), ), ], ), @@ -198,37 +205,45 @@ reviewDetails(data, rate, myRate) { mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - padding: languageID == 'ar' ? EdgeInsets.only(right: 60) : EdgeInsets.only(left: 60), - child: - RatingBar( - initialRating: myRate, - direction: Axis.horizontal, - allowHalfRating: true, - itemCount: 5, - itemSize: 20, - ignoreGestures: true, - ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + padding: languageID == 'ar' ? EdgeInsets.only(right: 60) : EdgeInsets.only(left: 60), + child: RatingBar( + initialRating: myRate, + direction: Axis.horizontal, + allowHalfRating: true, + itemCount: 5, + itemSize: 20, + ignoreGestures: true, + ratingWidget: RatingWidget( + full: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + ), + empty: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + ), + tapOnlyMode: true, + itemPadding: EdgeInsets.symmetric(horizontal: 4.0), + onRatingUpdate: (rating) { + print(rating); + }, + ) + // RatingBar.readOnly( + // initialRating: myRate, + // size: 15.0, + // filledColor: Colors.yellow[700], + // emptyColor: Colors.grey[500], + // isHalfAllowed: true, + // halfFilledIcon: Icons.star_half, + // filledIcon: Icons.star, + // emptyIcon: Icons.star, + // ), ), - tapOnlyMode: true, - itemPadding: EdgeInsets.symmetric(horizontal: 4.0), - onRatingUpdate: (rating) { - print(rating); - }, - ) - // RatingBar.readOnly( - // initialRating: myRate, - // size: 15.0, - // filledColor: Colors.yellow[700], - // emptyColor: Colors.grey[500], - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: Icons.star, - // ), - ), ], ), ), diff --git a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart index 2724aabe..6bea9208 100644 --- a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart +++ b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -307,11 +308,12 @@ class _ProductNameAndPriceState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/pharmacies/screens/product-details/recommended_products.dart b/lib/pages/pharmacies/screens/product-details/recommended_products.dart index a9057c6e..7f646971 100644 --- a/lib/pages/pharmacies/screens/product-details/recommended_products.dart +++ b/lib/pages/pharmacies/screens/product-details/recommended_products.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -303,11 +304,12 @@ class _RecommendedProductsState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/pharmacies/screens/product-details/reviews_info.dart b/lib/pages/pharmacies/screens/product-details/reviews_info.dart index 744f8386..0fdac7a9 100644 --- a/lib/pages/pharmacies/screens/product-details/reviews_info.dart +++ b/lib/pages/pharmacies/screens/product-details/reviews_info.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart'; @@ -71,18 +72,19 @@ class ReviewsInfo extends StatelessWidget { // ), RatingBar( initialRating: previousModel! - .productDetailService[0]!.reviews![index]!.rating!.toDouble(), + .productDetailService[0].reviews![index].rating!.toDouble(), direction: Axis.horizontal, allowHalfRating: true, itemCount: 5, itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); @@ -91,18 +93,19 @@ class ReviewsInfo extends StatelessWidget { ): RatingBar( initialRating: previousModel! - .productDetailService[0]!.reviews![index]!.rating!.toDouble(), + .productDetailService[0].reviews![index].rating!.toDouble(), direction: Axis.horizontal, allowHalfRating: true, itemCount: 5, itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index 6fd84701..9e303152 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -295,11 +295,12 @@ class ProductTileItem extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart b/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart index 704d0663..3eee39e6 100644 --- a/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart +++ b/lib/pages/pharmacies/widgets/home/PrescriptionsWidget.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; @@ -170,10 +171,11 @@ class PrescriptionsWidget extends StatelessWidget { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), + unratedColor: Colors.grey[500], tapOnlyMode: true, itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 19e932de..6e086f34 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart' import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -121,11 +122,12 @@ class _ProductReviewPageState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); @@ -193,11 +195,12 @@ class _ProductReviewPageState extends State { itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star), - half: Icon(Icons.star_half), - empty: Icon(Icons.star), + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star, color: CustomColors.accentColor,), ), tapOnlyMode: true, + unratedColor: Colors.grey[500], itemPadding: EdgeInsets.symmetric(horizontal: 4.0), onRatingUpdate: (rating) { print(rating); diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart index dc0663f1..7c1f398e 100644 --- a/lib/pages/sub_categorise_page.dart +++ b/lib/pages/sub_categorise_page.dart @@ -690,15 +690,15 @@ class _SubCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, @@ -839,15 +839,15 @@ class _SubCategorisePageState extends State { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Colors.yellow[700], + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Colors.grey[500], + color: CustomColors.accentColor, ), ), onRatingUpdate: (double value) {}, diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart index a554b96e..853183a9 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart @@ -1,509 +1,509 @@ -import 'dart:convert'; -import 'dart:async'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -import '../utils/websocket.dart' if (dart.library.js) '../utils/websocket_web.dart'; -import '../utils/turn.dart' if (dart.library.js) '../utils/turn_web.dart'; - - -enum SignalingState { Open, Closed, Error } -enum CallState { Calling, Ringing, Invite, Connected, Bye } - - -const JsonEncoder _encoder = JsonEncoder(); -const JsonDecoder _decoder = JsonDecoder(); - -class SessionOneToOne { - late String id; - late SocketUser local_user; - late SocketUser remote_user; - SessionOneToOne({required this.id, required this.local_user, required this.remote_user}); - - - late RTCPeerConnection pc; - late RTCDataChannel dc; - List remoteCandidates = []; -} - -class SocketUser{ - String? id; - String? name; - String? userAgent; - Map? moreInfo; - - SocketUser({required this.id, required this.name, required this.userAgent, required this.moreInfo}); - - SocketUser.from(dynamic json){ - id = json['id']; - name = json['name']; - userAgent = json['user_agent']; - moreInfo = json['more_info']; - } - - Map toJson() => { - "id": id, - "name": name, - "user_agent": userAgent, - "more_info": moreInfo - }; -} - -class Signaling { - var _host; - var _turnCredential; - - SimpleWebSocket? _socket; - SessionOneToOne? session; - - Signaling(this._host, {required this.session}); - - late MediaStream? localStream; - late final List remoteStreams = []; - - late Function(SignalingState state) onSignalingStateChange; - late Function(SessionOneToOne session, CallState state) onCallStateChange; - late Function(MediaStream stream) onLocalStream; - late Function(SessionOneToOne session, MediaStream stream) onAddRemoteStream; - late Function(SessionOneToOne session, MediaStream stream) onRemoveRemoteStream; - late Function(dynamic event) onPeersUpdate; - late Function(dynamic event) onConnected; - late Function(dynamic event) onRemoteConnected; - late Function(SessionOneToOne session, RTCDataChannel dc, RTCDataChannelMessage data) onDataChannelMessage; - late Function(SessionOneToOne session, RTCDataChannel dc) onDataChannel; - - String? get sdpSemantics => WebRTC.platformIsWindows ? 'plan-b' : 'unified-plan'; - - Map _iceServers = { - 'iceServers': [ - {'url': 'stun:stun.l.google.com:19302'}, - /* - * turn server configuration example. - { - 'url': 'turn:123.45.67.89:3478', - 'username': 'change_to_real_user', - 'credential': 'change_to_real_secret' - }, - */ - ] - }; - - final Map _config = { - 'mandatory': {}, - 'optional': [ - {'DtlsSrtpKeyAgreement': true}, - ] - }; - - final Map _dcConstraints = { - 'mandatory': { - 'OfferToReceiveAudio': false, - 'OfferToReceiveVideo': false, - }, - 'optional': [], - }; - - - close() async { - await finishSessions(); - _socket?.close(); - } - - void switchCamera() { - if (localStream != null) { - Helper.switchCamera(localStream! .getVideoTracks()[0]); - } - } - - void muteMic() { - if (localStream != null) { - bool enabled = localStream!.getAudioTracks()[0].enabled; - localStream!.getAudioTracks()[0].enabled = !enabled; - } - } - - - callAccepted(SessionOneToOne session){ - _send('call_accepted', { - 'to': session.remote_user?.id, - 'from': session.local_user.id, - 'session_id': session.id, - }); - } - - void offer(String media, bool useScreen) async { - if(session == null) - return; - - if (media == 'data') { - _createDataChannel(session!); - } - _createOffer(session!, media); - onCallStateChange?.call(session!, CallState.Calling); - } - - void bye(SessionOneToOne session) { - _send('bye', { - 'session_id': session.id, - 'from': session.local_user.id, - }); - _closeSession(session); - } - - void onMessage(message) async { - Map mapData = message; - var data = mapData['data']; - - switch (mapData['type']) { - case 'call_accepted': - { - onRemoteConnected?.call(data); - } - break; - - case 'connected': - { - if (onConnected != null) { - onConnected?.call(data); - } - } - break; - - case 'offer': - { - - var peerId = data['from']; - var description = data['description']; - var media = data['media']; - - await _initPeerConnection(session!, media: media, screenSharing: false); - await session!.pc?.setRemoteDescription(RTCSessionDescription(description['sdp'], description['type'])); - await _createAnswer(session!, media); - - if (session!.remoteCandidates!.isNotEmpty) { - session!.remoteCandidates!.forEach((candidate) async { - await session!.pc?.addCandidate(candidate); - }); - session!.remoteCandidates.clear(); - } - onCallStateChange?.call(session!, CallState.Calling); - } - break; - case 'answer': - { - - var description = data['description']; - var sessionId = data['session_id']; - session!.pc?.setRemoteDescription( - RTCSessionDescription(description['sdp'], description['type'])); - } - break; - case 'candidate': - { - - var peerId = data['from']; - var candidateMap = data['candidate']; - var sessionId = data['session_id']; - RTCIceCandidate candidate = RTCIceCandidate(candidateMap['candidate'], - candidateMap['sdpMid'], candidateMap['sdpMLineIndex']); - - if (session != null) { - if (session!.pc != null) { - await session!.pc?.addCandidate(candidate); - } else { - session!.remoteCandidates.add(candidate); - } - } else { - // _sessions[sessionId] = SessionOneToOne(pid: peerId, sid: sessionId) - // ..remoteCandidates.add(candidate); - } - } - break; - case 'leave': - { - var peerId = data as String; - _closeSessionById(peerId); - } - break; - case 'bye': - { - - var sessionId = data['session_id']; - print('bye: ' + sessionId); - if (session != null) { - onCallStateChange?.call(session!, CallState.Bye); - _closeSession(session!); - } - } - break; - case 'keepalive': - { - print('keepalive response!'); - } - break; - default: - break; - } - } - - Future connect() async { - _socket = SimpleWebSocket('$_host/ws'); - - if (_turnCredential == null) { - try { - _turnCredential = await getTurnCredential(_host); - /* - { - "username": "1584195784:mbzrxpgjys", - "password": "isyl6FF6nqMTB9/ig5MrMRUXqZg", - "ttl": 86400, - "uris": ["turn:127.0.0.1:19302?transport=udp"] - } - */ - _iceServers = { - 'iceServers': [ - { - 'urls': _turnCredential['uris'][0], - 'username': _turnCredential['username'], - 'credential': _turnCredential['password'] - }, - ] - }; - } catch (e) {} - } - - _socket?.onOpen = () { - print('onOpen'); - onSignalingStateChange?.call(SignalingState.Open); - _send('connect', session!.local_user!.toJson()); - }; - - _socket?.onMessage = (message) { - print('Received data: ' + message); - onMessage(_decoder.convert(message)); - }; - - _socket?.onClose = (int code, String reason) { - print('Closed by server [$code => $reason]!'); - onSignalingStateChange?.call(SignalingState.Closed); - }; - - await _socket?.connect(); - } - - Future createStream(String media, bool userScreen) async { - final Map mediaConstraints = { - 'audio': userScreen ? false : true, - 'video': userScreen - ? true - : { - 'mandatory': { - 'minWidth': '640', // Provide your own width, height and frame rate here - 'minHeight': '480', - 'minFrameRate': '30', - }, - 'facingMode': 'user', - 'optional': [], - } - }; - - MediaStream stream = userScreen - ? await navigator.mediaDevices.getDisplayMedia(mediaConstraints) - : await navigator.mediaDevices.getUserMedia(mediaConstraints); - onLocalStream?.call(stream); - return stream; - } - - Future _initPeerConnection(SessionOneToOne session, {required String media, required bool screenSharing}) async { - - if (media != 'data') - localStream = await createStream(media, screenSharing); - print(_iceServers); - RTCPeerConnection pc = await createPeerConnection({ - ..._iceServers, - ...{'sdpSemantics': sdpSemantics} - }, _config); - if (media != 'data') { - switch (sdpSemantics) { - case 'plan-b': - pc.onAddStream = (MediaStream stream) { - onAddRemoteStream?.call(session, stream); - remoteStreams.add(stream); - }; - await pc.addStream(localStream!); - break; - case 'unified-plan': - // Unified-Plan - pc.onTrack = (event) { - if (event.track.kind == 'video') { - onAddRemoteStream?.call(session, event.streams[0]); - } - }; - localStream! .getTracks().forEach((track) { - pc.addTrack(track, localStream!); - }); - break; - } - - // Unified-Plan: Simuclast - /* - await pc.addTransceiver( - track: _localStream.getAudioTracks()[0], - init: RTCRtpTransceiverInit( - direction: TransceiverDirection.SendOnly, streams: [_localStream]), - ); - - await pc.addTransceiver( - track: _localStream.getVideoTracks()[0], - init: RTCRtpTransceiverInit( - direction: TransceiverDirection.SendOnly, - streams: [ - _localStream - ], - sendEncodings: [ - RTCRtpEncoding(rid: 'f', active: true), - RTCRtpEncoding( - rid: 'h', - active: true, - scaleResolutionDownBy: 2.0, - maxBitrate: 150000, - ), - RTCRtpEncoding( - rid: 'q', - active: true, - scaleResolutionDownBy: 4.0, - maxBitrate: 100000, - ), - ]), - );*/ - /* - var sender = pc.getSenders().find(s => s.track.kind == "video"); - var parameters = sender.getParameters(); - if(!parameters) - parameters = {}; - parameters.encodings = [ - { rid: "h", active: true, maxBitrate: 900000 }, - { rid: "m", active: true, maxBitrate: 300000, scaleResolutionDownBy: 2 }, - { rid: "l", active: true, maxBitrate: 100000, scaleResolutionDownBy: 4 } - ]; - sender.setParameters(parameters); - */ - } - pc.onIceCandidate = (candidate) async { - if (candidate == null) { - print('onIceCandidate: complete!'); - return; - } - // This delay is needed to allow enough time to try an ICE candidate - // before skipping to the next one. 1 second is just an heuristic value - // and should be thoroughly tested in your own environment. - await Future.delayed( - const Duration(seconds: 1), - () => _send('candidate', { - 'to': session.remote_user?.id, - 'from': session.local_user.id, - 'candidate': { - 'sdpMLineIndex': candidate.sdpMLineIndex, // sdpMlineIndex or sdpMLineIndex - 'sdpMid': candidate.sdpMid, - 'candidate': candidate.candidate, - }, - 'session_id': session.id, - })); - }; - - pc.onIceConnectionState = (state) {}; - - pc.onRemoveStream = (stream) { - onRemoveRemoteStream?.call(session, stream); - remoteStreams.removeWhere((it) { - return (it.id == stream.id); - }); - }; - - pc.onDataChannel = (channel) { - _addDataChannel(session, channel); - }; - - session.pc = pc; - return session; - } - - void _addDataChannel(SessionOneToOne session, RTCDataChannel channel) { - channel.onDataChannelState = (e) {}; - channel.onMessage = (RTCDataChannelMessage data) { - onDataChannelMessage?.call(session, channel, data); - }; - session.dc = channel; - onDataChannel?.call(session, channel); - } - - Future _createDataChannel(SessionOneToOne session, {label= 'fileTransfer'}) async { - RTCDataChannelInit dataChannelDict = RTCDataChannelInit() - ..maxRetransmits = 30; - RTCDataChannel channel = - await session.pc .createDataChannel(label, dataChannelDict); - _addDataChannel(session, channel); - } - - Future _createOffer(SessionOneToOne session, String media) async { - try { - RTCSessionDescription s = - await session.pc .createOffer(media == 'data' ? _dcConstraints : {}); - await session.pc .setLocalDescription(s); - _send('offer', { - 'to': session.remote_user?.id, - 'from': session.local_user.id, - 'description': {'sdp': s.sdp, 'type': s.type}, - 'session_id': session.id, - 'media': media, - }); - } catch (e) { - print(e.toString()); - } - } - - Future _createAnswer(SessionOneToOne session, String media) async { - try { - RTCSessionDescription s = - await session.pc .createAnswer(media == 'data' ? _dcConstraints : {}); - await session.pc .setLocalDescription(s); - _send('answer', { - 'to': session.remote_user?.id, - 'from': session.local_user.id, - 'description': {'sdp': s.sdp, 'type': s.type}, - 'session_id': session.id, - }); - } catch (e) { - print(e.toString()); - } - } - - _send(event, data) { - var request = Map(); - request["type"] = event; - request["data"] = data; - _socket?.send(_encoder.convert(request)); - } - - Future finishSessions() async { - _closeSessionById(session!.id); - } - - void _closeSessionById(String sessionId) { - if (session != null && session!.id == sessionId) { - _closeSession(session!); - onCallStateChange?.call(session!, CallState.Bye); - } - } - - Future _closeSession(SessionOneToOne session) async { - localStream?.getTracks()?.forEach((element) async { - await element.stop(); - }); - await localStream?.dispose(); - localStream = null; - - await session.pc?.close(); - await session.dc?.close(); - } -} +// import 'dart:convert'; +// import 'dart:async'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// import '../utils/websocket.dart' if (dart.library.js) '../utils/websocket_web.dart'; +// import '../utils/turn.dart' if (dart.library.js) '../utils/turn_web.dart'; +// +// +// enum SignalingState { Open, Closed, Error } +// enum CallState { Calling, Ringing, Invite, Connected, Bye } +// +// +// const JsonEncoder _encoder = JsonEncoder(); +// const JsonDecoder _decoder = JsonDecoder(); +// +// class SessionOneToOne { +// late String id; +// late SocketUser local_user; +// late SocketUser remote_user; +// SessionOneToOne({required this.id, required this.local_user, required this.remote_user}); +// +// +// late RTCPeerConnection pc; +// late RTCDataChannel dc; +// List remoteCandidates = []; +// } +// +// class SocketUser{ +// String? id; +// String? name; +// String? userAgent; +// Map? moreInfo; +// +// SocketUser({required this.id, required this.name, required this.userAgent, required this.moreInfo}); +// +// SocketUser.from(dynamic json){ +// id = json['id']; +// name = json['name']; +// userAgent = json['user_agent']; +// moreInfo = json['more_info']; +// } +// +// Map toJson() => { +// "id": id, +// "name": name, +// "user_agent": userAgent, +// "more_info": moreInfo +// }; +// } +// +// class Signaling { +// var _host; +// var _turnCredential; +// +// SimpleWebSocket? _socket; +// SessionOneToOne? session; +// +// Signaling(this._host, {required this.session}); +// +// late MediaStream? localStream; +// late final List remoteStreams = []; +// +// late Function(SignalingState state) onSignalingStateChange; +// late Function(SessionOneToOne session, CallState state) onCallStateChange; +// late Function(MediaStream stream) onLocalStream; +// late Function(SessionOneToOne session, MediaStream stream) onAddRemoteStream; +// late Function(SessionOneToOne session, MediaStream stream) onRemoveRemoteStream; +// late Function(dynamic event) onPeersUpdate; +// late Function(dynamic event) onConnected; +// late Function(dynamic event) onRemoteConnected; +// late Function(SessionOneToOne session, RTCDataChannel dc, RTCDataChannelMessage data) onDataChannelMessage; +// late Function(SessionOneToOne session, RTCDataChannel dc) onDataChannel; +// +// String? get sdpSemantics => WebRTC.platformIsWindows ? 'plan-b' : 'unified-plan'; +// +// Map _iceServers = { +// 'iceServers': [ +// {'url': 'stun:stun.l.google.com:19302'}, +// /* +// * turn server configuration example. +// { +// 'url': 'turn:123.45.67.89:3478', +// 'username': 'change_to_real_user', +// 'credential': 'change_to_real_secret' +// }, +// */ +// ] +// }; +// +// final Map _config = { +// 'mandatory': {}, +// 'optional': [ +// {'DtlsSrtpKeyAgreement': true}, +// ] +// }; +// +// final Map _dcConstraints = { +// 'mandatory': { +// 'OfferToReceiveAudio': false, +// 'OfferToReceiveVideo': false, +// }, +// 'optional': [], +// }; +// +// +// close() async { +// await finishSessions(); +// _socket?.close(); +// } +// +// void switchCamera() { +// if (localStream != null) { +// Helper.switchCamera(localStream! .getVideoTracks()[0]); +// } +// } +// +// void muteMic() { +// if (localStream != null) { +// bool enabled = localStream!.getAudioTracks()[0].enabled; +// localStream!.getAudioTracks()[0].enabled = !enabled; +// } +// } +// +// +// callAccepted(SessionOneToOne session){ +// _send('call_accepted', { +// 'to': session.remote_user?.id, +// 'from': session.local_user.id, +// 'session_id': session.id, +// }); +// } +// +// void offer(String media, bool useScreen) async { +// if(session == null) +// return; +// +// if (media == 'data') { +// _createDataChannel(session!); +// } +// _createOffer(session!, media); +// onCallStateChange?.call(session!, CallState.Calling); +// } +// +// void bye(SessionOneToOne session) { +// _send('bye', { +// 'session_id': session.id, +// 'from': session.local_user.id, +// }); +// _closeSession(session); +// } +// +// void onMessage(message) async { +// Map mapData = message; +// var data = mapData['data']; +// +// switch (mapData['type']) { +// case 'call_accepted': +// { +// onRemoteConnected?.call(data); +// } +// break; +// +// case 'connected': +// { +// if (onConnected != null) { +// onConnected?.call(data); +// } +// } +// break; +// +// case 'offer': +// { +// +// var peerId = data['from']; +// var description = data['description']; +// var media = data['media']; +// +// await _initPeerConnection(session!, media: media, screenSharing: false); +// await session!.pc?.setRemoteDescription(RTCSessionDescription(description['sdp'], description['type'])); +// await _createAnswer(session!, media); +// +// if (session!.remoteCandidates!.isNotEmpty) { +// session!.remoteCandidates!.forEach((candidate) async { +// await session!.pc?.addCandidate(candidate); +// }); +// session!.remoteCandidates.clear(); +// } +// onCallStateChange?.call(session!, CallState.Calling); +// } +// break; +// case 'answer': +// { +// +// var description = data['description']; +// var sessionId = data['session_id']; +// session!.pc?.setRemoteDescription( +// RTCSessionDescription(description['sdp'], description['type'])); +// } +// break; +// case 'candidate': +// { +// +// var peerId = data['from']; +// var candidateMap = data['candidate']; +// var sessionId = data['session_id']; +// RTCIceCandidate candidate = RTCIceCandidate(candidateMap['candidate'], +// candidateMap['sdpMid'], candidateMap['sdpMLineIndex']); +// +// if (session != null) { +// if (session!.pc != null) { +// await session!.pc?.addCandidate(candidate); +// } else { +// session!.remoteCandidates.add(candidate); +// } +// } else { +// // _sessions[sessionId] = SessionOneToOne(pid: peerId, sid: sessionId) +// // ..remoteCandidates.add(candidate); +// } +// } +// break; +// case 'leave': +// { +// var peerId = data as String; +// _closeSessionById(peerId); +// } +// break; +// case 'bye': +// { +// +// var sessionId = data['session_id']; +// print('bye: ' + sessionId); +// if (session != null) { +// onCallStateChange?.call(session!, CallState.Bye); +// _closeSession(session!); +// } +// } +// break; +// case 'keepalive': +// { +// print('keepalive response!'); +// } +// break; +// default: +// break; +// } +// } +// +// Future connect() async { +// _socket = SimpleWebSocket('$_host/ws'); +// +// if (_turnCredential == null) { +// try { +// _turnCredential = await getTurnCredential(_host); +// /* +// { +// "username": "1584195784:mbzrxpgjys", +// "password": "isyl6FF6nqMTB9/ig5MrMRUXqZg", +// "ttl": 86400, +// "uris": ["turn:127.0.0.1:19302?transport=udp"] +// } +// */ +// _iceServers = { +// 'iceServers': [ +// { +// 'urls': _turnCredential['uris'][0], +// 'username': _turnCredential['username'], +// 'credential': _turnCredential['password'] +// }, +// ] +// }; +// } catch (e) {} +// } +// +// _socket?.onOpen = () { +// print('onOpen'); +// onSignalingStateChange?.call(SignalingState.Open); +// _send('connect', session!.local_user!.toJson()); +// }; +// +// _socket?.onMessage = (message) { +// print('Received data: ' + message); +// onMessage(_decoder.convert(message)); +// }; +// +// _socket?.onClose = (int code, String reason) { +// print('Closed by server [$code => $reason]!'); +// onSignalingStateChange?.call(SignalingState.Closed); +// }; +// +// await _socket?.connect(); +// } +// +// Future createStream(String media, bool userScreen) async { +// final Map mediaConstraints = { +// 'audio': userScreen ? false : true, +// 'video': userScreen +// ? true +// : { +// 'mandatory': { +// 'minWidth': '640', // Provide your own width, height and frame rate here +// 'minHeight': '480', +// 'minFrameRate': '30', +// }, +// 'facingMode': 'user', +// 'optional': [], +// } +// }; +// +// MediaStream stream = userScreen +// ? await navigator.mediaDevices.getDisplayMedia(mediaConstraints) +// : await navigator.mediaDevices.getUserMedia(mediaConstraints); +// onLocalStream?.call(stream); +// return stream; +// } +// +// Future _initPeerConnection(SessionOneToOne session, {required String media, required bool screenSharing}) async { +// +// if (media != 'data') +// localStream = await createStream(media, screenSharing); +// print(_iceServers); +// RTCPeerConnection pc = await createPeerConnection({ +// ..._iceServers, +// ...{'sdpSemantics': sdpSemantics} +// }, _config); +// if (media != 'data') { +// switch (sdpSemantics) { +// case 'plan-b': +// pc.onAddStream = (MediaStream stream) { +// onAddRemoteStream?.call(session, stream); +// remoteStreams.add(stream); +// }; +// await pc.addStream(localStream!); +// break; +// case 'unified-plan': +// // Unified-Plan +// pc.onTrack = (event) { +// if (event.track.kind == 'video') { +// onAddRemoteStream?.call(session, event.streams[0]); +// } +// }; +// localStream! .getTracks().forEach((track) { +// pc.addTrack(track, localStream!); +// }); +// break; +// } +// +// // Unified-Plan: Simuclast +// /* +// await pc.addTransceiver( +// track: _localStream.getAudioTracks()[0], +// init: RTCRtpTransceiverInit( +// direction: TransceiverDirection.SendOnly, streams: [_localStream]), +// ); +// +// await pc.addTransceiver( +// track: _localStream.getVideoTracks()[0], +// init: RTCRtpTransceiverInit( +// direction: TransceiverDirection.SendOnly, +// streams: [ +// _localStream +// ], +// sendEncodings: [ +// RTCRtpEncoding(rid: 'f', active: true), +// RTCRtpEncoding( +// rid: 'h', +// active: true, +// scaleResolutionDownBy: 2.0, +// maxBitrate: 150000, +// ), +// RTCRtpEncoding( +// rid: 'q', +// active: true, +// scaleResolutionDownBy: 4.0, +// maxBitrate: 100000, +// ), +// ]), +// );*/ +// /* +// var sender = pc.getSenders().find(s => s.track.kind == "video"); +// var parameters = sender.getParameters(); +// if(!parameters) +// parameters = {}; +// parameters.encodings = [ +// { rid: "h", active: true, maxBitrate: 900000 }, +// { rid: "m", active: true, maxBitrate: 300000, scaleResolutionDownBy: 2 }, +// { rid: "l", active: true, maxBitrate: 100000, scaleResolutionDownBy: 4 } +// ]; +// sender.setParameters(parameters); +// */ +// } +// pc.onIceCandidate = (candidate) async { +// if (candidate == null) { +// print('onIceCandidate: complete!'); +// return; +// } +// // This delay is needed to allow enough time to try an ICE candidate +// // before skipping to the next one. 1 second is just an heuristic value +// // and should be thoroughly tested in your own environment. +// await Future.delayed( +// const Duration(seconds: 1), +// () => _send('candidate', { +// 'to': session.remote_user?.id, +// 'from': session.local_user.id, +// 'candidate': { +// 'sdpMLineIndex': candidate.sdpMLineIndex, // sdpMlineIndex or sdpMLineIndex +// 'sdpMid': candidate.sdpMid, +// 'candidate': candidate.candidate, +// }, +// 'session_id': session.id, +// })); +// }; +// +// pc.onIceConnectionState = (state) {}; +// +// pc.onRemoveStream = (stream) { +// onRemoveRemoteStream?.call(session, stream); +// remoteStreams.removeWhere((it) { +// return (it.id == stream.id); +// }); +// }; +// +// pc.onDataChannel = (channel) { +// _addDataChannel(session, channel); +// }; +// +// session.pc = pc; +// return session; +// } +// +// void _addDataChannel(SessionOneToOne session, RTCDataChannel channel) { +// channel.onDataChannelState = (e) {}; +// channel.onMessage = (RTCDataChannelMessage data) { +// onDataChannelMessage?.call(session, channel, data); +// }; +// session.dc = channel; +// onDataChannel?.call(session, channel); +// } +// +// Future _createDataChannel(SessionOneToOne session, {label= 'fileTransfer'}) async { +// RTCDataChannelInit dataChannelDict = RTCDataChannelInit() +// ..maxRetransmits = 30; +// RTCDataChannel channel = +// await session.pc .createDataChannel(label, dataChannelDict); +// _addDataChannel(session, channel); +// } +// +// Future _createOffer(SessionOneToOne session, String media) async { +// try { +// RTCSessionDescription s = +// await session.pc .createOffer(media == 'data' ? _dcConstraints : {}); +// await session.pc .setLocalDescription(s); +// _send('offer', { +// 'to': session.remote_user?.id, +// 'from': session.local_user.id, +// 'description': {'sdp': s.sdp, 'type': s.type}, +// 'session_id': session.id, +// 'media': media, +// }); +// } catch (e) { +// print(e.toString()); +// } +// } +// +// Future _createAnswer(SessionOneToOne session, String media) async { +// try { +// RTCSessionDescription s = +// await session.pc .createAnswer(media == 'data' ? _dcConstraints : {}); +// await session.pc .setLocalDescription(s); +// _send('answer', { +// 'to': session.remote_user?.id, +// 'from': session.local_user.id, +// 'description': {'sdp': s.sdp, 'type': s.type}, +// 'session_id': session.id, +// }); +// } catch (e) { +// print(e.toString()); +// } +// } +// +// _send(event, data) { +// var request = Map(); +// request["type"] = event; +// request["data"] = data; +// _socket?.send(_encoder.convert(request)); +// } +// +// Future finishSessions() async { +// _closeSessionById(session!.id); +// } +// +// void _closeSessionById(String sessionId) { +// if (session != null && session!.id == sessionId) { +// _closeSession(session!); +// onCallStateChange?.call(session!, CallState.Bye); +// } +// } +// +// Future _closeSession(SessionOneToOne session) async { +// localStream?.getTracks()?.forEach((element) async { +// await element.stop(); +// }); +// await localStream?.dispose(); +// localStream = null; +// +// await session.pc?.close(); +// await session.dc?.close(); +// } +// } diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart b/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart index 04c6019d..d17bffe3 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart @@ -1,241 +1,241 @@ -import 'dart:async'; - -import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart'; -import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; -import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/utils/device_info.dart'; -import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'dart:core'; -import 'signaling.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -class StartVideoCall extends StatefulWidget { - static String tag = 'webrtc'; - final String host; - - String caller; - String receiver; - bool iAmCaller; - StartVideoCall({required this.caller, required this.receiver, this.iAmCaller = false, required this.host}); - - @override - StartVideoCallState createState() => StartVideoCallState(receiverId: receiver, callerId: caller, iAmCaller: iAmCaller); -} - -class StartVideoCallState extends State { - late Signaling _signaling; - late SessionOneToOne? _session; - - StartVideoCallState({required String callerId, required String receiverId, required bool iAmCaller}){ - - final self_role = iAmCaller ? "Caller" : "Receiver"; - final self_id = iAmCaller ? callerId : receiverId; - final self_user = SocketUser(id: self_id, name: "$self_role-$self_id", userAgent: DeviceInfo.userAgent, moreInfo: {}); - - final remote_role = !iAmCaller ? "Caller" : "Receiver"; - final remote_id = !iAmCaller ? callerId : receiverId; - final remote_user = SocketUser(id: remote_id, name: "$remote_role-$remote_id", userAgent: DeviceInfo.userAgent, moreInfo: {}); - - final session_id = "$callerId-$receiverId"; - _session = SessionOneToOne(id: session_id, local_user: self_user, remote_user: remote_user); - } - - bool showNoise = true; - final StreamController _audioButton = StreamController.broadcast(); - final StreamController _videoButton = StreamController.broadcast(); - final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); - final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); - - final RTCVideoRenderer _localRenderer = RTCVideoRenderer(); - final RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); - - MediaStream get localMediaStream => _signaling.localStream!; - MediaStream get remoteMediaStream => _signaling.remoteStreams.first; - - @override - initState() { - super.initState(); - initRenderers(); - _connect(); - } - - initRenderers() async { - await _localRenderer.initialize(); - await _remoteRenderer.initialize(); - } - - @override - deactivate() { - super.deactivate(); - _signaling?.close(); - _localRenderer.dispose(); - _remoteRenderer.dispose(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - // appBar: AppBar( - // title: Text('P2P Call Sample' + (_session?.local_user != null ? ' [Your ID (${_session?.local_user?.id})] ' : '')), - // actions: [ - // IconButton( - // icon: const Icon(Icons.settings), - // onPressed: (){ - // setState(() { - // }); - // }, - // tooltip: 'setup', - // ), - // ], - // ), - body: videoCanvasWidgets(), - ); - } - - LayoutBuilder videoCanvasWidgets() { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return Stack( - children: [ - CamViewWidget( - localRenderer: _localRenderer, - remoteRenderer: _remoteRenderer, - constraints: constraints, - onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, - onButtonBarHeightStreamController: _onButtonBarHeightStreamController, - ), - ConferenceButtonBar( - audioEnabled: _audioButton.stream, - videoEnabled: _videoButton.stream, - onAudioEnabled: _onAudioEnable, - onVideoEnabled: _onVideoEnabled, - onSwitchCamera: _onSwitchCamera, - onHangup: _onHangup, - onPersonAdd: () {}, - onPersonRemove: () {}, - onHeight: _onHeightBar, - onShow: _onShowBar, - onHide: _onHideBar, - ), - ], - ); - }, - ); - } - - - void _connect() async { - if(_session == null) - return; - - _signaling ??= Signaling(widget.host, session: _session!)..connect(); - - _signaling?.onSignalingStateChange = (SignalingState state) { - switch (state) { - case SignalingState.Closed: - case SignalingState.Error: - case SignalingState.Open: - break; - } - }; - - _signaling?.onCallStateChange = (SessionOneToOne session, CallState state) { - switch (state) { - case CallState.Calling: - setState(() {}); - break; - case CallState.Bye: - setState(() { - _localRenderer.srcObject = null; - _remoteRenderer.srcObject = null; - _session = null; - }); - break; - case CallState.Invite: - case CallState.Connected: - case CallState.Ringing: - } - }; - - _signaling?.onConnected = ((event) { - _signaling?.callAccepted(_session!); - }); - - _signaling?.onRemoteConnected = ((event) { - - }); - - _signaling?.onLocalStream = ((stream) { - _localRenderer.srcObject = stream; - setState(() { - }); - }); - - _signaling?.onAddRemoteStream = ((_, stream) { - _remoteRenderer.srcObject = stream; - setState(() {}); - }); - - _signaling?.onRemoveRemoteStream = ((_, stream) { - setState(() { - _remoteRenderer.srcObject = null; - }); - }); - } - - _hangUp() async{ - if (_session != null) { - _signaling?.bye(_session!); - } - } - - _switchCamera() { - _signaling?.switchCamera(); - } - - _muteMic() { - _signaling?.muteMic(); - } - - Function? _onAudioEnable() { - final audioTrack = localMediaStream.getAudioTracks()[0]; - final mute = audioTrack.muted; - Helper.setMicrophoneMute(!mute!, audioTrack); - _audioButton.add(mute); - } - - Function? _onVideoEnabled() { - final videoTrack = localMediaStream.getVideoTracks()[0]; - bool videoEnabled = videoTrack.enabled; - localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; - _videoButton.add(!videoEnabled); - } - - Function? _onSwitchCamera() { - Helper.switchCamera(localMediaStream.getVideoTracks()[0]); - } - - void _onShowBar() { - setState(() { - }); - _onButtonBarVisibleStreamController.add(true); - } - - void _onHeightBar(double height) { - _onButtonBarHeightStreamController.add(height); - } - - void _onHideBar() { - setState(() { - SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom]); - }); - _onButtonBarVisibleStreamController.add(false); - } - - Future _onHangup() async { - _signaling?.finishSessions(); - print('onHangup'); - Navigator.of(context).pop(); - } -} \ No newline at end of file +// import 'dart:async'; +// +// import 'package:diplomaticquarterapp/pages/conference/conference_button_bar.dart'; +// import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; +// import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/utils/device_info.dart'; +// import 'package:firebase_messaging/firebase_messaging.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// import 'dart:core'; +// import 'signaling.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// class StartVideoCall extends StatefulWidget { +// static String tag = 'webrtc'; +// final String host; +// +// String caller; +// String receiver; +// bool iAmCaller; +// StartVideoCall({required this.caller, required this.receiver, this.iAmCaller = false, required this.host}); +// +// @override +// StartVideoCallState createState() => StartVideoCallState(receiverId: receiver, callerId: caller, iAmCaller: iAmCaller); +// } +// +// class StartVideoCallState extends State { +// late Signaling _signaling; +// late SessionOneToOne? _session; +// +// StartVideoCallState({required String callerId, required String receiverId, required bool iAmCaller}){ +// +// final self_role = iAmCaller ? "Caller" : "Receiver"; +// final self_id = iAmCaller ? callerId : receiverId; +// final self_user = SocketUser(id: self_id, name: "$self_role-$self_id", userAgent: DeviceInfo.userAgent, moreInfo: {}); +// +// final remote_role = !iAmCaller ? "Caller" : "Receiver"; +// final remote_id = !iAmCaller ? callerId : receiverId; +// final remote_user = SocketUser(id: remote_id, name: "$remote_role-$remote_id", userAgent: DeviceInfo.userAgent, moreInfo: {}); +// +// final session_id = "$callerId-$receiverId"; +// _session = SessionOneToOne(id: session_id, local_user: self_user, remote_user: remote_user); +// } +// +// bool showNoise = true; +// final StreamController _audioButton = StreamController.broadcast(); +// final StreamController _videoButton = StreamController.broadcast(); +// final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); +// final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); +// +// final RTCVideoRenderer _localRenderer = RTCVideoRenderer(); +// final RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); +// +// MediaStream get localMediaStream => _signaling.localStream!; +// MediaStream get remoteMediaStream => _signaling.remoteStreams.first; +// +// @override +// initState() { +// super.initState(); +// initRenderers(); +// _connect(); +// } +// +// initRenderers() async { +// await _localRenderer.initialize(); +// await _remoteRenderer.initialize(); +// } +// +// @override +// deactivate() { +// super.deactivate(); +// _signaling?.close(); +// _localRenderer.dispose(); +// _remoteRenderer.dispose(); +// } +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// // appBar: AppBar( +// // title: Text('P2P Call Sample' + (_session?.local_user != null ? ' [Your ID (${_session?.local_user?.id})] ' : '')), +// // actions: [ +// // IconButton( +// // icon: const Icon(Icons.settings), +// // onPressed: (){ +// // setState(() { +// // }); +// // }, +// // tooltip: 'setup', +// // ), +// // ], +// // ), +// body: videoCanvasWidgets(), +// ); +// } +// +// LayoutBuilder videoCanvasWidgets() { +// return LayoutBuilder( +// builder: (BuildContext context, BoxConstraints constraints) { +// return Stack( +// children: [ +// CamViewWidget( +// localRenderer: _localRenderer, +// remoteRenderer: _remoteRenderer, +// constraints: constraints, +// onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, +// onButtonBarHeightStreamController: _onButtonBarHeightStreamController, +// ), +// ConferenceButtonBar( +// audioEnabled: _audioButton.stream, +// videoEnabled: _videoButton.stream, +// onAudioEnabled: _onAudioEnable, +// onVideoEnabled: _onVideoEnabled, +// onSwitchCamera: _onSwitchCamera, +// onHangup: _onHangup, +// onPersonAdd: () {}, +// onPersonRemove: () {}, +// onHeight: _onHeightBar, +// onShow: _onShowBar, +// onHide: _onHideBar, +// ), +// ], +// ); +// }, +// ); +// } +// +// +// void _connect() async { +// if(_session == null) +// return; +// +// _signaling ??= Signaling(widget.host, session: _session!)..connect(); +// +// _signaling?.onSignalingStateChange = (SignalingState state) { +// switch (state) { +// case SignalingState.Closed: +// case SignalingState.Error: +// case SignalingState.Open: +// break; +// } +// }; +// +// _signaling?.onCallStateChange = (SessionOneToOne session, CallState state) { +// switch (state) { +// case CallState.Calling: +// setState(() {}); +// break; +// case CallState.Bye: +// setState(() { +// _localRenderer.srcObject = null; +// _remoteRenderer.srcObject = null; +// _session = null; +// }); +// break; +// case CallState.Invite: +// case CallState.Connected: +// case CallState.Ringing: +// } +// }; +// +// _signaling?.onConnected = ((event) { +// _signaling?.callAccepted(_session!); +// }); +// +// _signaling?.onRemoteConnected = ((event) { +// +// }); +// +// _signaling?.onLocalStream = ((stream) { +// _localRenderer.srcObject = stream; +// setState(() { +// }); +// }); +// +// _signaling?.onAddRemoteStream = ((_, stream) { +// _remoteRenderer.srcObject = stream; +// setState(() {}); +// }); +// +// _signaling?.onRemoveRemoteStream = ((_, stream) { +// setState(() { +// _remoteRenderer.srcObject = null; +// }); +// }); +// } +// +// _hangUp() async{ +// if (_session != null) { +// _signaling?.bye(_session!); +// } +// } +// +// _switchCamera() { +// _signaling?.switchCamera(); +// } +// +// _muteMic() { +// _signaling?.muteMic(); +// } +// +// Function? _onAudioEnable() { +// final audioTrack = localMediaStream.getAudioTracks()[0]; +// final mute = audioTrack.muted; +// Helper.setMicrophoneMute(!mute!, audioTrack); +// _audioButton.add(mute); +// } +// +// Function? _onVideoEnabled() { +// final videoTrack = localMediaStream.getVideoTracks()[0]; +// bool videoEnabled = videoTrack.enabled; +// localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; +// _videoButton.add(!videoEnabled); +// } +// +// Function? _onSwitchCamera() { +// Helper.switchCamera(localMediaStream.getVideoTracks()[0]); +// } +// +// void _onShowBar() { +// setState(() { +// }); +// _onButtonBarVisibleStreamController.add(true); +// } +// +// void _onHeightBar(double height) { +// _onButtonBarHeightStreamController.add(height); +// } +// +// void _onHideBar() { +// setState(() { +// SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom]); +// }); +// _onButtonBarVisibleStreamController.add(false); +// } +// +// Future _onHangup() async { +// _signaling?.finishSessions(); +// print('onHangup'); +// Navigator.of(context).pop(); +// } +// } \ No newline at end of file diff --git a/lib/pages/webRTC/signaling_bkp.dart b/lib/pages/webRTC/signaling_bkp.dart index 3c79357c..3b716ab6 100644 --- a/lib/pages/webRTC/signaling_bkp.dart +++ b/lib/pages/webRTC/signaling_bkp.dart @@ -1,242 +1,242 @@ -import 'dart:convert'; - -// import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -typedef void StreamStateCallback(MediaStream stream); - -class Signaling { - Map configuration = { - 'iceServers': [ - { - 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] - } - ] - }; - - late RTCPeerConnection peerConnection; - late MediaStream localStream; - late MediaStream remoteStream; - late String roomId; - late String currentRoomText; - late StreamStateCallback onAddRemoteStream; - - Future createRoom(RTCVideoRenderer remoteRenderer) async { - // FirebaseFirestore db = FirebaseFirestore.instance; - // DocumentReference roomRef = db.collection('rooms').doc(); - - print('Create PeerConnection with configuration: $configuration'); - - peerConnection = await createPeerConnection(configuration); - - registerPeerConnectionListeners(); - - localStream.getTracks().forEach((track) { - peerConnection?.addTrack(track, localStream); - }); - - // Code for collecting ICE candidates below - // var callerCandidatesCollection = roomRef.collection('callerCandidates'); - - peerConnection?.onIceCandidate = (RTCIceCandidate candidate) { - print('Got candidate: ${candidate.toMap()}'); - // callerCandidatesCollection.add(candidate.toMap()); - }; - // Finish Code for collecting ICE candidate - - // Add code for creating a room - RTCSessionDescription offer = await peerConnection.createOffer(); - await peerConnection.setLocalDescription(offer); - print('Created offer: $offer'); - - Map roomWithOffer = {'offer': offer.toMap()}; - - // await roomRef.set(roomWithOffer); - // var roomId = roomRef.id; - print('New room created with SDK offer. Room ID: $roomId'); - currentRoomText = 'Current room is $roomId - You are the caller!'; - // Created a Room - - peerConnection?.onTrack = (RTCTrackEvent event) { - print('Got remote track: ${event.streams[0]}'); - - event.streams[0].getTracks().forEach((track) { - print('Add a track to the remoteStream $track'); - remoteStream?.addTrack(track); - }); - }; - - // Listening for remote session description below - // roomRef.snapshots().listen((snapshot) async { - // print('Got updated room: ${snapshot.data()}'); - // - // Map data = snapshot.data() as Map; - // if (peerConnection?.getRemoteDescription() != null && data['answer'] != null) { - // var answer = RTCSessionDescription( - // data['answer']['sdp'], - // data['answer']['type'], - // ); - // - // print("Someone tried to connect"); - // await peerConnection?.setRemoteDescription(answer); - // } - // }); - // // Listening for remote session description above - // - // // Listen for remote Ice candidates below - // roomRef.collection('calleeCandidates').snapshots().listen((snapshot) { - // snapshot.docChanges.forEach((change) { - // if (change.type == DocumentChangeType.added) { - // Map data = change.doc.data() as Map; - // print('Got new remote ICE candidate: ${jsonEncode(data)}'); - // peerConnection.addCandidate( - // RTCIceCandidate( - // data['candidate'], - // data['sdpMid'], - // data['sdpMLineIndex'], - // ), - // ); - // } - // }); - // }); - // Listen for remote ICE candidates above - - return roomId; - } - - Future joinRoom(String roomId, RTCVideoRenderer remoteVideo) async { - // FirebaseFirestore db = FirebaseFirestore.instance; - // DocumentReference roomRef = db.collection('rooms').doc('$roomId'); - // var roomSnapshot = await roomRef.get(); - // print('Got room ${roomSnapshot.exists}'); - - // if (roomSnapshot.exists) { - // print('Create PeerConnection with configuration: $configuration'); - // peerConnection = await createPeerConnection(configuration); - // - // registerPeerConnectionListeners(); - // - // localStream.getTracks().forEach((track) { - // peerConnection?.addTrack(track, localStream); - // }); - // - // // Code for collecting ICE candidates below - // // var calleeCandidatesCollection = roomRef.collection('calleeCandidates'); - // peerConnection.onIceCandidate = (RTCIceCandidate candidate) { - // if (candidate == null) { - // print('onIceCandidate: complete!'); - // return; - // } - // print('onIceCandidate: ${candidate.toMap()}'); - // // calleeCandidatesCollection.add(candidate.toMap()); - // }; - // // Code for collecting ICE candidate above - // - // peerConnection?.onTrack = (RTCTrackEvent event) { - // print('Got remote track: ${event.streams[0]}'); - // event.streams[0].getTracks().forEach((track) { - // print('Add a track to the remoteStream: $track'); - // remoteStream?.addTrack(track); - // }); - // }; - // - // // Code for creating SDP answer below - // var data = roomSnapshot.data() as Map; - // print('Got offer $data'); - // var offer = data['offer']; - // await peerConnection?.setRemoteDescription( - // RTCSessionDescription(offer['sdp'], offer['type']), - // ); - // var answer = await peerConnection.createAnswer(); - // print('Created Answer $answer'); - // - // await peerConnection.setLocalDescription(answer); - // - // Map roomWithAnswer = { - // 'answer': {'type': answer.type, 'sdp': answer.sdp} - // }; - // - // await roomRef.update(roomWithAnswer); - // // Finished creating SDP answer - // - // // Listening for remote ICE candidates below - // // roomRef.collection('callerCandidates').snapshots().listen((snapshot) { - // // snapshot.docChanges.forEach((document) { - // // var data = document.doc.data() as Map; - // // print(data); - // // print('Got new remote ICE candidate: $data'); - // // peerConnection.addCandidate( - // // RTCIceCandidate( - // // data['candidate'], - // // data['sdpMid'], - // // data['sdpMLineIndex'], - // // ), - // // ); - // // }); - // // }); - // } - } - - Future openUserMedia( - RTCVideoRenderer localVideo, - RTCVideoRenderer remoteVideo, - ) async { - var stream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': false}); - - localVideo.srcObject = stream; - localStream = stream; - - remoteVideo.srcObject = await createLocalMediaStream('key'); - } - - Future hangUp(RTCVideoRenderer localVideo) async { - List tracks = localVideo.srcObject!.getTracks(); - tracks.forEach((track) { - track.stop(); - }); - - if (remoteStream != null) { - remoteStream.getTracks().forEach((track) => track.stop()); - } - if (peerConnection != null) peerConnection.close(); - - if (roomId != null) { - // var db = FirebaseFirestore.instance; - // var roomRef = db.collection('rooms').doc(roomId); - // var calleeCandidates = await roomRef.collection('calleeCandidates').get(); - // calleeCandidates.docs.forEach((document) => document.reference.delete()); - - // var callerCandidates = await roomRef.collection('callerCandidates').get(); - // callerCandidates.docs.forEach((document) => document.reference.delete()); - - // await roomRef.delete(); - } - - localStream.dispose(); - remoteStream?.dispose(); - } - - void registerPeerConnectionListeners() { - peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { - print('ICE gathering state changed: $state'); - }; - - peerConnection?.onConnectionState = (RTCPeerConnectionState state) { - print('Connection state change: $state'); - }; - - peerConnection?.onSignalingState = (RTCSignalingState state) { - print('Signaling state change: $state'); - }; - - peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { - print('ICE connection state change: $state'); - }; - - peerConnection?.onAddStream = (MediaStream stream) { - print("Add remote stream"); - onAddRemoteStream?.call(stream); - remoteStream = stream; - }; - } -} +// import 'dart:convert'; +// +// // import 'package:cloud_firestore/cloud_firestore.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// typedef void StreamStateCallback(MediaStream stream); +// +// class Signaling { +// Map configuration = { +// 'iceServers': [ +// { +// 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] +// } +// ] +// }; +// +// late RTCPeerConnection peerConnection; +// late MediaStream localStream; +// late MediaStream remoteStream; +// late String roomId; +// late String currentRoomText; +// late StreamStateCallback onAddRemoteStream; +// +// Future createRoom(RTCVideoRenderer remoteRenderer) async { +// // FirebaseFirestore db = FirebaseFirestore.instance; +// // DocumentReference roomRef = db.collection('rooms').doc(); +// +// print('Create PeerConnection with configuration: $configuration'); +// +// peerConnection = await createPeerConnection(configuration); +// +// registerPeerConnectionListeners(); +// +// localStream.getTracks().forEach((track) { +// peerConnection?.addTrack(track, localStream); +// }); +// +// // Code for collecting ICE candidates below +// // var callerCandidatesCollection = roomRef.collection('callerCandidates'); +// +// peerConnection?.onIceCandidate = (RTCIceCandidate candidate) { +// print('Got candidate: ${candidate.toMap()}'); +// // callerCandidatesCollection.add(candidate.toMap()); +// }; +// // Finish Code for collecting ICE candidate +// +// // Add code for creating a room +// RTCSessionDescription offer = await peerConnection.createOffer(); +// await peerConnection.setLocalDescription(offer); +// print('Created offer: $offer'); +// +// Map roomWithOffer = {'offer': offer.toMap()}; +// +// // await roomRef.set(roomWithOffer); +// // var roomId = roomRef.id; +// print('New room created with SDK offer. Room ID: $roomId'); +// currentRoomText = 'Current room is $roomId - You are the caller!'; +// // Created a Room +// +// peerConnection?.onTrack = (RTCTrackEvent event) { +// print('Got remote track: ${event.streams[0]}'); +// +// event.streams[0].getTracks().forEach((track) { +// print('Add a track to the remoteStream $track'); +// remoteStream?.addTrack(track); +// }); +// }; +// +// // Listening for remote session description below +// // roomRef.snapshots().listen((snapshot) async { +// // print('Got updated room: ${snapshot.data()}'); +// // +// // Map data = snapshot.data() as Map; +// // if (peerConnection?.getRemoteDescription() != null && data['answer'] != null) { +// // var answer = RTCSessionDescription( +// // data['answer']['sdp'], +// // data['answer']['type'], +// // ); +// // +// // print("Someone tried to connect"); +// // await peerConnection?.setRemoteDescription(answer); +// // } +// // }); +// // // Listening for remote session description above +// // +// // // Listen for remote Ice candidates below +// // roomRef.collection('calleeCandidates').snapshots().listen((snapshot) { +// // snapshot.docChanges.forEach((change) { +// // if (change.type == DocumentChangeType.added) { +// // Map data = change.doc.data() as Map; +// // print('Got new remote ICE candidate: ${jsonEncode(data)}'); +// // peerConnection.addCandidate( +// // RTCIceCandidate( +// // data['candidate'], +// // data['sdpMid'], +// // data['sdpMLineIndex'], +// // ), +// // ); +// // } +// // }); +// // }); +// // Listen for remote ICE candidates above +// +// return roomId; +// } +// +// Future joinRoom(String roomId, RTCVideoRenderer remoteVideo) async { +// // FirebaseFirestore db = FirebaseFirestore.instance; +// // DocumentReference roomRef = db.collection('rooms').doc('$roomId'); +// // var roomSnapshot = await roomRef.get(); +// // print('Got room ${roomSnapshot.exists}'); +// +// // if (roomSnapshot.exists) { +// // print('Create PeerConnection with configuration: $configuration'); +// // peerConnection = await createPeerConnection(configuration); +// // +// // registerPeerConnectionListeners(); +// // +// // localStream.getTracks().forEach((track) { +// // peerConnection?.addTrack(track, localStream); +// // }); +// // +// // // Code for collecting ICE candidates below +// // // var calleeCandidatesCollection = roomRef.collection('calleeCandidates'); +// // peerConnection.onIceCandidate = (RTCIceCandidate candidate) { +// // if (candidate == null) { +// // print('onIceCandidate: complete!'); +// // return; +// // } +// // print('onIceCandidate: ${candidate.toMap()}'); +// // // calleeCandidatesCollection.add(candidate.toMap()); +// // }; +// // // Code for collecting ICE candidate above +// // +// // peerConnection?.onTrack = (RTCTrackEvent event) { +// // print('Got remote track: ${event.streams[0]}'); +// // event.streams[0].getTracks().forEach((track) { +// // print('Add a track to the remoteStream: $track'); +// // remoteStream?.addTrack(track); +// // }); +// // }; +// // +// // // Code for creating SDP answer below +// // var data = roomSnapshot.data() as Map; +// // print('Got offer $data'); +// // var offer = data['offer']; +// // await peerConnection?.setRemoteDescription( +// // RTCSessionDescription(offer['sdp'], offer['type']), +// // ); +// // var answer = await peerConnection.createAnswer(); +// // print('Created Answer $answer'); +// // +// // await peerConnection.setLocalDescription(answer); +// // +// // Map roomWithAnswer = { +// // 'answer': {'type': answer.type, 'sdp': answer.sdp} +// // }; +// // +// // await roomRef.update(roomWithAnswer); +// // // Finished creating SDP answer +// // +// // // Listening for remote ICE candidates below +// // // roomRef.collection('callerCandidates').snapshots().listen((snapshot) { +// // // snapshot.docChanges.forEach((document) { +// // // var data = document.doc.data() as Map; +// // // print(data); +// // // print('Got new remote ICE candidate: $data'); +// // // peerConnection.addCandidate( +// // // RTCIceCandidate( +// // // data['candidate'], +// // // data['sdpMid'], +// // // data['sdpMLineIndex'], +// // // ), +// // // ); +// // // }); +// // // }); +// // } +// } +// +// Future openUserMedia( +// RTCVideoRenderer localVideo, +// RTCVideoRenderer remoteVideo, +// ) async { +// var stream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': false}); +// +// localVideo.srcObject = stream; +// localStream = stream; +// +// remoteVideo.srcObject = await createLocalMediaStream('key'); +// } +// +// Future hangUp(RTCVideoRenderer localVideo) async { +// List tracks = localVideo.srcObject!.getTracks(); +// tracks.forEach((track) { +// track.stop(); +// }); +// +// if (remoteStream != null) { +// remoteStream.getTracks().forEach((track) => track.stop()); +// } +// if (peerConnection != null) peerConnection.close(); +// +// if (roomId != null) { +// // var db = FirebaseFirestore.instance; +// // var roomRef = db.collection('rooms').doc(roomId); +// // var calleeCandidates = await roomRef.collection('calleeCandidates').get(); +// // calleeCandidates.docs.forEach((document) => document.reference.delete()); +// +// // var callerCandidates = await roomRef.collection('callerCandidates').get(); +// // callerCandidates.docs.forEach((document) => document.reference.delete()); +// +// // await roomRef.delete(); +// } +// +// localStream.dispose(); +// remoteStream?.dispose(); +// } +// +// void registerPeerConnectionListeners() { +// peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { +// print('ICE gathering state changed: $state'); +// }; +// +// peerConnection?.onConnectionState = (RTCPeerConnectionState state) { +// print('Connection state change: $state'); +// }; +// +// peerConnection?.onSignalingState = (RTCSignalingState state) { +// print('Signaling state change: $state'); +// }; +// +// peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { +// print('ICE connection state change: $state'); +// }; +// +// peerConnection?.onAddStream = (MediaStream stream) { +// print("Add remote stream"); +// onAddRemoteStream?.call(stream); +// remoteStream = stream; +// }; +// } +// } diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 188403bd..ed7a4030 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -123,7 +123,7 @@ class LocationUtils { latitude: location.latitude!, longitude: location.longitude!, altitude: location.altitude!, - timestamp: null, + timestamp: DateTime.now(), accuracy: 1.0, heading: 0.0, speed: 0.0, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index ff2861cb..82aeda33 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -212,17 +212,17 @@ class DoctorCard extends StatelessWidget { ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: CustomColors.accentColor, - ), + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), ), + unratedColor: Colors.grey[500], onRatingUpdate: (double value) {}), ], ), diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 5ced91ba..73bbc50f 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -150,6 +150,7 @@ class DoctorHeader extends StatelessWidget { color: CustomColors.accentColor, ), ), + unratedColor: Colors.grey[500], onRatingUpdate: (double value) {}), SizedBox(width: 6), Text( @@ -299,21 +300,22 @@ class DoctorHeader extends StatelessWidget { itemSize: 20.0, allowHalfRating: true, initialRating: - this.headerModel!.decimalDoctorRate! != null ? double.tryParse(this.headerModel!.decimalDoctorRate!)! : this.headerModel!.actualDoctorRate!.toDouble(), + this.headerModel.decimalDoctorRate != null ? double.tryParse(this.headerModel.decimalDoctorRate)! : this.headerModel.actualDoctorRate!.toDouble(), ratingWidget: RatingWidget( full: Icon( Icons.star, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), half: Icon( Icons.star_half, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), empty: Icon( Icons.star_border, - color: Color(0XFFD02127), + color: CustomColors.accentColor, ), ), + unratedColor: Colors.grey[500], onRatingUpdate: (double value) {}), // RatingBar( // initialRating: this.headerModel!.decimalDoctorRate! != null ? double.tryParse(this.headerModel!.decimalDoctorRate!)! : this.headerModel!.actualDoctorRate!.toDouble(), diff --git a/lib/widgets/offers_packages/PackagesOfferCard.dart b/lib/widgets/offers_packages/PackagesOfferCard.dart index 3e539b1e..cd59224a 100644 --- a/lib/widgets/offers_packages/PackagesOfferCard.dart +++ b/lib/widgets/offers_packages/PackagesOfferCard.dart @@ -47,7 +47,11 @@ class PackagesItemCardState extends State { aspectRatio: 144 / 144, child: ClipRRect( borderRadius: BorderRadius.circular(12.0), - child: Image.network(widget.itemModel!.images!.isNotEmpty ? widget.itemModel!.images![0].src! : "https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), + child: Image.network( + widget.itemModel!.images!.isNotEmpty ? widget.itemModel!.images![0].src! : "https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", + fit: BoxFit.fill, + height: 180.0, + width: 180.0), ), ), SizedBox(height: 6), @@ -100,20 +104,27 @@ class PackagesItemCardState extends State { ), ), RatingBar( - initialRating: 4.5, // todo ask haroon about parameter for rating - // size: 18.0, - // filledColor: Color(0XFFD02127), - // emptyColor: Color(0XFFD02127), - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: , - // - ratingWidget: RatingWidget( full:Icon(Icons.star, color:Color(0XFFD02127)), half:Icon(Icons.star_half, color: Color(0XFFD02127)), empty: Icon(Icons.star_border,color: Color(0XFFD02127)) , - ), onRatingUpdate: (double value) { }), + initialRating: 4.5, // todo ask haroon about parameter for rating + // size: 18.0, + // filledColor: Color(0XFFD02127), + // emptyColor: Color(0XFFD02127), + // isHalfAllowed: true, + // halfFilledIcon: Icons.star_half, + // filledIcon: Icons.star, + // emptyIcon: , + // + ratingWidget: RatingWidget( + full: Icon(Icons.star, color: CustomColors.accentColor,), + half: Icon(Icons.star_half, color: CustomColors.accentColor,), + empty: Icon(Icons.star_border, color: CustomColors.accentColor,), + ), + ignoreGestures: true, + updateOnDrag: false, + unratedColor: Colors.grey[500], + onRatingUpdate: (double value) {}), ], ), - if(widget.onCartClick != null) + if (widget.onCartClick != null) InkWell( child: SvgPicture.asset("assets/images/new/add_to_cart.svg"), onTap: () { diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 7a511cbd..e6b6f350 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -13,7 +14,6 @@ import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; - class productTile extends StatelessWidget { final String? productName; final String? productPrice; @@ -99,10 +99,7 @@ class productTile extends StatelessWidget { child: RichText( text: TextSpan( text: productName, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), ), ), ) @@ -111,10 +108,7 @@ class productTile extends StatelessWidget { child: RichText( text: TextSpan( text: productName, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), ), ), ), @@ -127,10 +121,7 @@ class productTile extends StatelessWidget { child: RichText( text: TextSpan( text: 'SAR $productPrice', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), ), ), ) @@ -139,10 +130,7 @@ class productTile extends StatelessWidget { child: RichText( text: TextSpan( text: 'SAR $productPrice', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), ), ), ), @@ -164,23 +152,18 @@ class productTile extends StatelessWidget { // halfFilledIcon: Icons.star_half, // filledIcon: Icons.star, // emptyIcon: Icons.star, - itemBuilder: (BuildContext context, int index) => Icon( + itemBuilder: (BuildContext context, int index) => Icon( Icons.star, - color: Colors.yellow[700], + color: CustomColors.accentColor, size: 15, - ), onRatingUpdate: (double value) { - - }, - + ), + onRatingUpdate: (double value) {}, ), ), ), Text( '${approvedTotalReviews} ${TranslationBase.of(context).reviews}', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), ), ], ) @@ -218,9 +201,7 @@ class productTile extends StatelessWidget { GifLoaderDialogUtils.hideDialog(context); Utils.navigateToCartPage(); } else { - AppToast.showErrorToast( - message: TranslationBase.of(context) - .needPrescription); + AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); } }, ), @@ -239,13 +220,8 @@ class productTile extends StatelessWidget { margin: EdgeInsets.only(bottom: 5.0), child: RichText( text: TextSpan( - text: TranslationBase.of(context).quantity + - "" + - '$qyt', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), + text: TranslationBase.of(context).quantity + "" + '$qyt', + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), ), ), ), @@ -271,10 +247,7 @@ class productTile extends StatelessWidget { RichText( text: TextSpan( text: ' $totalPrice SAR', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 15), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15), ), ), ], @@ -304,7 +277,26 @@ class productTile extends StatelessWidget { // isHalfAllowed: true, // halfFilledIcon: Icons.star_half, // filledIcon: , - ratingWidget: RatingWidget(full: Icon(Icons.star, color:Colors.yellow[700], size: 15,), half: Icon(Icons.star_half, color:Colors.grey[500], size: 15), empty: Icon(Icons.star_half, color:Colors.grey[500], size: 15)), onRatingUpdate: (double value) { }, + ratingWidget: RatingWidget( + full: Icon( + Icons.star, + color: CustomColors.accentColor, + size: 15, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + size: 15, + ), + empty: Icon( + Icons.star_half, + color: CustomColors.accentColor, + size: 15, + ), + ), + updateOnDrag: false, + unratedColor: Colors.grey[500], + onRatingUpdate: (double value) {}, ), ), ), @@ -314,33 +306,21 @@ class productTile extends StatelessWidget { // alignment: Alignment.topLeft, child: RichText( text: TextSpan( - text: - '${productReviews} ${TranslationBase.of(context).reviews}', + text: '${productReviews} ${TranslationBase.of(context).reviews}', // text: '($productReviews reviews)', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.grey, - fontSize: 13), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), ), ), ), ), InkWell( onTap: () { - Navigator.push( - context, FadePage(page: ProductReviewPage(product!))); + Navigator.push(context, FadePage(page: ProductReviewPage(product!))); }, child: Container( - padding: - EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), + padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), height: 30.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange, - style: BorderStyle.solid, - width: 1.0), - color: Colors.transparent, - borderRadius: BorderRadius.circular(5.0)), + decoration: BoxDecoration(border: Border.all(color: Colors.orange, style: BorderStyle.solid, width: 1.0), color: Colors.transparent, borderRadius: BorderRadius.circular(5.0)), child: Text( TranslationBase.of(context).writeReview, style: TextStyle( diff --git a/pubspec.yaml b/pubspec.yaml index 45d72049..a3d041c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -126,7 +126,7 @@ dependencies: jiffy: ^6.2.1 #Flutter WebRTC - flutter_webrtc: ^0.9.7 + #flutter_webrtc: ^0.9.7 screen_brightness: ^0.2.2+1 google_maps_place_picker_mb: ^3.0.0 map_launcher: ^3.0.1 @@ -149,7 +149,7 @@ dependencies: badges: ^3.1.2 flutter_app_icon_badge: ^2.0.0 dropdown_search: 5.0.6 - youtube_player_flutter: ^8.0.0 + youtube_player_flutter: ^8.1.2 shimmer: ^3.0.0 carousel_slider: ^4.0.0