integrated share plus package

This commit is contained in:
vishal-kaklotar-wdi
2025-11-19 13:13:16 +05:30
parent 1ca940e5cf
commit 7dbeef2f80
5 changed files with 37 additions and 11 deletions

View File

@@ -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,

View File

@@ -5,7 +5,6 @@ class AttractionDetailsViewModel {
// 📞 Call method
Future<void> makePhoneCall(String phoneNumber, BuildContext context) async {
final Uri url = Uri(scheme: 'tel', path: phoneNumber);
if (await canLaunchUrl(url)) {
await launchUrl(url);
} else {

View File

@@ -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,

View File

@@ -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:

View File

@@ -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: