diff --git a/lib/attraction_details/view/attraction_details_view.dart b/lib/attraction_details/view/attraction_details_view.dart index b5b0dc6..b300b03 100644 --- a/lib/attraction_details/view/attraction_details_view.dart +++ b/lib/attraction_details/view/attraction_details_view.dart @@ -7,6 +7,7 @@ import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:share_plus/share_plus.dart'; import '../../core/route_constants.dart'; class AttractionDetailsView extends StatelessWidget { @@ -98,12 +99,16 @@ class AttractionDetailsView extends StatelessWidget { right: 17.w, child: GestureDetector( onTap: () { - showModalBottomSheet( - context: context, - isScrollControlled: true, - backgroundColor: Colors.transparent, - builder: (context) => const ShareBottomSheet(), + Share.share( + 'Check out my City Card app!', + subject: 'City Card App', ); + // showModalBottomSheet( + // context: context, + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // builder: (context) => const ShareBottomSheet(), + // ); }, child: Container( height: 36.h, diff --git a/lib/attraction_details/view_model/attraction_details_view_model.dart b/lib/attraction_details/view_model/attraction_details_view_model.dart index f3b186d..22832af 100644 --- a/lib/attraction_details/view_model/attraction_details_view_model.dart +++ b/lib/attraction_details/view_model/attraction_details_view_model.dart @@ -5,7 +5,6 @@ class AttractionDetailsViewModel { // 📞 Call method Future makePhoneCall(String phoneNumber, BuildContext context) async { final Uri url = Uri(scheme: 'tel', path: phoneNumber); - if (await canLaunchUrl(url)) { await launchUrl(url); } else { diff --git a/lib/offer_pass_detail/offer_pass_detail_view.dart b/lib/offer_pass_detail/offer_pass_detail_view.dart index 488c17f..6f8a4a9 100644 --- a/lib/offer_pass_detail/offer_pass_detail_view.dart +++ b/lib/offer_pass_detail/offer_pass_detail_view.dart @@ -4,6 +4,7 @@ import 'package:citycards_customer/common_packages/custom_bullet_points.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:share_plus/share_plus.dart'; class OfferPassDetailView extends StatelessWidget { const OfferPassDetailView({super.key}); @@ -91,12 +92,16 @@ class OfferPassDetailView extends StatelessWidget { right: 17.w, child: GestureDetector( onTap: () { - showModalBottomSheet( - context: context, - isScrollControlled: true, - backgroundColor: Colors.transparent, - builder: (context) => const ShareBottomSheet(), + Share.share( + 'Check out my City Card app!', + subject: 'City Card App', ); + // showModalBottomSheet( + // context: context, + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // builder: (context) => const ShareBottomSheet(), + // ); }, child: Container( height: 36.h, diff --git a/pubspec.lock b/pubspec.lock index 8e12fcc..0f05218 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -725,6 +725,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + share_plus: + dependency: "direct main" + description: + name: share_plus + sha256: "14c8860d4de93d3a7e53af51bff479598c4e999605290756bbbe45cf65b37840" + url: "https://pub.dev" + source: hosted + version: "12.0.1" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a" + url: "https://pub.dev" + source: hosted + version: "6.1.0" shared_preferences: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 04c7df5..4c38472 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -52,6 +52,7 @@ dependencies: lottie: ^3.3.2 flutter_native_splash: ^2.4.7 url_launcher: ^6.3.2 + share_plus: ^12.0.1 dev_dependencies: flutter_test: