open_share_plus 1.0.0 open_share_plus: ^1.0.0 copied to clipboard
Flutter Plugin for sharing contents to social media.You can use it share to Mail, Phone, WhatsApp And System Share UI.
import 'package:flutter/material.dart';
import 'package:open_share_plus/open.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('open_share_plus'),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Open.browser(url: "https://datadirr.com");
},
child: const Text("Open Browser")),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Open.phone(phoneNumber: "+919726428397");
},
child: const Text("Open Phone Dial")),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Open.mail(
toAddress: "datadirr@gmail.com",
subject: "datadirr",
body: "datadirr dev");
},
child: const Text("Send Mail")),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Open.whatsApp(
whatsAppNumber: "919726428397", text: "datadirr");
},
child: const Text("Send WhatsApp")),
const SizedBox(height: 20)
],
),
),
);
}
}