share_and_open_url

Last updated:

0 purchases

share_and_open_url Image
share_and_open_url Images
Add to Cart

Description:

share and open url

share_and_open_url provides functionality for sharing text and opening URLs. It allows users to easily share content and quickly access web links.
Table of contents #


Platforms


Installation


Import


Usage


Screenshots


License


Platforms #
✅ Android (Kotlin)
✅ iOS (Swift)
Installation #
dependencies:
share_and_open_url: ^0.0.7
copied to clipboard
Usage #
final class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
final ShareAndOpenUrl _shareAndOpenUrlPlugin = ShareAndOpenUrl();

Future<void> _shareText() async {
try {
await _shareAndOpenUrlPlugin.shareText("Hello from Flutter!");
} on PlatformException catch (e) {
throw PlatformException(code: e.code, message: "Failed to share text: '${e.message}'.");
}
}

Future<void> _openUrl() async {
try {
await _shareAndOpenUrlPlugin.openUrl("https://flutter.dev/");
} on PlatformException catch (e) {
throw PlatformException(code: e.code, message: "Failed to open url: '${e.message}'.");
}
}

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: _shareText,
child: const Text('Share Text'),
),
ElevatedButton(
onPressed: _openUrl,
child: const Text('Open URL'),
),
],
),
),
),
);
}
}
copied to clipboard
Screenshots #






License #
MIT

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.