share_social_media_plugin 1.0.8 copy "share_social_media_plugin: ^1.0.8" to clipboard
share_social_media_plugin: ^1.0.8 copied to clipboard

discontinued
outdated

Share social media plugin, share Line, Twitter, FB, Instagram and more!, I try develop step for step. Any suggestion please contact me.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:io' show Platform;
import 'package:share_social_media_plugin/share_social_media_plugin.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final twitterLogin = new ShareSocialMediaPlugin(
      consumerKey: "YOUR CONSUMER KEY",
      consumerSecret: 'YOUR CONSUMER SECRECT');
  var titleTwitterButton = "Connect Twitter";

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    twitterLogin.isSessionActive.then((value) {
      if (value) {
        titleTwitterButton = "Share in twitter";
      } else {
        titleTwitterButton = "Connect to Twitter";
      }
      setState(() {});
    });

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Share social media'),
        ),
        body: Column(
          children: <Widget>[
            RaisedButton(
              onPressed: () async {
                await ShareSocialMediaPlugin.shareLine("http://www.google.com");
              },
              child: Text('Share in Line', style: TextStyle(fontSize: 20)),
            ),
            RaisedButton(
              child: Text(titleTwitterButton, style: TextStyle(fontSize: 20)),
              onPressed: () async {
                if (Platform.isAndroid) {
                  twitterLogin.shareTwitter("conectado desde plugin");
                } else if (Platform.isIOS) {
                  var sessionTwitter = await twitterLogin.currentSessionIOS();
                  var tweet = await twitterLogin.shareTwitteriOS(
                      sessionTwitter["outhToken"],
                      sessionTwitter["oauthTokenSecret"],
                      "ありがとう",
                      twitterLogin.consumerKey,
                      twitterLogin.consumerSecret);
                  print(tweet.body.toString());
                }
              },
            ),
            RaisedButton(
              onPressed: () async {
                await ShareSocialMediaPlugin.shareInstagram("hello","assets/nofumar.jpg");
              },
              child: Text('Share in Instagram', style: TextStyle(fontSize: 20)),
            ),
          ],
        ),
      ),
    );
  }
}
18
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Share social media plugin, share Line, Twitter, FB, Instagram and more!, I try develop step for step. Any suggestion please contact me.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, flutter, http, intl, random_string

More

Packages that depend on share_social_media_plugin