sign_button 2.0.4 copy "sign_button: ^2.0.4" to clipboard
sign_button: ^2.0.4 copied to clipboard

A Flutter plugin for generating sign in buttons for different social media accounts.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Sign in Button Demo',
      theme: ThemeData.light(),
      darkTheme: ThemeData.dark(),
      themeMode: ThemeMode.system,
      home: MyHomePage(title: 'Sign in Button Demo'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  String _buttonClick = "click sign in button";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title!),
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                '$_buttonClick',
                style: Theme.of(context).textTheme.headlineSmall,
              ),
              SizedBox(
                height: 5.0,
              ),
              SignInButton(
                  buttonType: ButtonType.apple,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "apple";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.appleDark,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(5.0),
                  ),
                  onPressed: () {
                    setState(() {
                      _buttonClick = "appleDark";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.facebook,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "facebook";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.facebookDark,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "facebookDark";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.twitter,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "twitter";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.github,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "github";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.githubDark,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "githubDark";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.google,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "google";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.googleDark,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "googleDark";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.linkedin,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "linkedIn";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.youtube,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "youtube";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.microsoft,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "microsoft";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.tumblr,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "tumblr";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.pinterest,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "pinterest";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.mail,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "Mail";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.reddit,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "reddit";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.yahoo,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "yahoo";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.amazon,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "amazon";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.quora,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "quora";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.instagram,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "instagram";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.discord,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "discord";
                    });
                  }),
              SignInButton(
                  buttonType: ButtonType.discordCircle,
                  onPressed: () {
                    setState(() {
                      _buttonClick = "discord";
                    });
                  }),
              //custom button
              SignInButton(
                  buttonType: ButtonType.pinterest,
                  imagePosition: ImagePosition.right,
                  //[buttonSize] You can also use this in combination with [width]. Increases the font and icon size of the button.
                  buttonSize: ButtonSize.large,
                  btnTextColor: Colors.grey,
                  btnColor: Colors.white,
                  width: 140,
                  //[width] Use if you change the text value.
                  btnText: 'Pinterest',
                  onPressed: () {
                    setState(() {
                      _buttonClick = "pinterest";
                    });
                  }),
              //disabled button
              SignInButton(
                  buttonType: ButtonType.yahoo,
                  //btnDisabledColor: Colors.grey,
                  //btnDisabledTextColor: Colors.grey[700],
                  onPressed: null),
              SignInButton.mini(
                buttonType: ButtonType.github,
                onPressed: () {},
              ),
              //disabled mini button
              SignInButton.mini(
                buttonType: ButtonType.github,
                //btnDisabledColor: Colors.grey,
                onPressed: null,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
172
likes
0
pub points
93%
popularity

Publisher

verified publisheraemreesen.com

A Flutter plugin for generating sign in buttons for different social media accounts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sign_button