share_everywhere 0.0.2 copy "share_everywhere: ^0.0.2" to clipboard
share_everywhere: ^0.0.2 copied to clipboard

Social sharing for all platforms. This plugin is a wrapper for the native share plugin for Android, iOS and Web.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:share_everywhere/share_everywhere.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  ShareController shareController = ShareController(
    title: "Share on:",
    elevatedButtonText: Text("Share"),
    networks: [
      SocialConfig(type: "facebook", appId: "your-facebook-app-id"),
      SocialConfig(type: "linkedin"),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Click the share button below:',
            ),
            ShareButton(shareController, "https://example.com")
          ],
        ),
      ),
    );
  }
}
10
likes
120
pub points
71%
popularity

Publisher

unverified uploader

Social sharing for all platforms. This plugin is a wrapper for the native share plugin for Android, iOS and Web.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, share_plus, url_launcher

More

Packages that depend on share_everywhere