搜索插件、代码仓与 APP 分类

flutter_social_button 封面
插件详情v1.1.6+1

flutter_social_button

Flutter 社交按钮是一个 Flutter 包,可轻松为任何 Flutter 应用创建社交媒体登录按钮。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
68
喜欢数
41
Pub 分数
140

安装插件

flutter pub add flutter_social_button

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Flutter 社交按钮是一个轻量级包,可简化在 Flutter 应用中集成社交媒体登录按钮的过程。它为 Google、Facebook 和 Apple 等热门平台提供预设计且可自定义的按钮,从而提升用户身份验证流程。该包支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台,确保跨平台一致性。通过最少的设置,开发者可以快速为其应用添加视觉吸引力强的社交登录选项。

适合场景

  • 向认证屏幕添加社交登录按钮
  • 通过快速登录选项提升用户入门体验
  • 在多个平台上创建一致的用户界面
  • 集成 Google、Facebook 和 Apple 登录
  • 自定义按钮样式以实现品牌一致

主要特点

  • 预构建的社交媒体按钮模板
  • 跨平台支持(Android、iOS、Web、macOS、Windows、Linux)
  • 轻松自定义颜色和大小
  • 通过 pub.dev 的简单集成
  • 支持主要社交平台

适合对象

  • Flutter 开发人员构建身份验证流程
  • 需要快速社交登录的应用
  • 旨在实现跨平台一致用户界面的项目
  • 注重开发速度的团队
  • 注重设计的应用程序

使用建议

  • 每个社交提供商都需要额外配置
  • 可能需要特定平台的设置(例如,OAuth 密钥)
  • 除非扩展,否则仅限预定义按钮设计
  • 依赖外部社交API实现功能
  • 不适合用于超出样式的自定义按钮逻辑

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter Social Button

Flutter Social Button

pub package pub points LinkedIn Instagram Facebook Youtube


Features

Flutter Social Button is a Flutter package to easily add social media buttons to your app. Buttons are customizable, and the package supports a wide range of social platforms.


Getting Started

Add the following dependency to your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_social_button: ^latest_version

Usage Example

import flutter_social_button.dart


import 'package:flutter_social_button/flutter_social_button.dart';

For built-in buttons.


// for full width Buttons

            //For default Button Its return a Email Button
               FlutterSocialButton(
                   onTap: () {}, ), 
                   
            //For facebook Button   
            
             FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.facebook, // Button type for different type buttons
              ),
              
          //For google Button
          
               FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.google, // Button type for different type buttons
                iconColor: Colors.black,  // for change icons colors
              ),  

           // for Mini Circle Button

                 FlutterSocialButton(
                    onTap: () {},
                    mini: true,   //just pass true for mini circle buttons
                    buttonType: ButtonType.phone,  // Button type for different type buttons
                  ),

Button Types

  • Facebook
  • Google
  • Yahoo
  • Twitter
  • LinkedIn
  • WhatsApp
  • Apple
  • GitHub
  • Phone
  • Email
  • Instagram
  • YouTube
  • Snapchat
  • Pinterest
  • TikTok
  • Reddit
  • Tumblr
  • Skype
  • Viber
  • Discord
  • WeChat
  • Line
  • Quora
  • Twitch
  • Flickr
  • Yelp
  • Spotify

Example

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Social Buttons"),
        centerTitle: true,
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              //For default Button
              FlutterSocialButton(
                onTap: () {},
              ),
              const SizedBox(
                height: 2,
              ),

              //For facebook Button
              FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.facebook,
              ),
              const SizedBox(
                height: 2,
              ),

              //For google Button
              FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.google,
              ),
              const SizedBox(
                height: 2,
              ),

              //For phone Button
              FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.phone,
              ),

              const SizedBox(
                height: 2,
              ),

              //For Whatsapp Button
              FlutterSocialButton(
                onTap: () {},
                buttonType: ButtonType.whatsapp,
              ),
              const SizedBox(
                height: 2,
              ),

              const Divider(
                color: Colors.black,
                thickness: 2.5,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  FlutterSocialButton(
                    onTap: () {},
                    mini: true,
                  ),
                  FlutterSocialButton(
                    onTap: () {},
                    mini: true,
                    buttonType: ButtonType.facebook,
                  ),
                  FlutterSocialButton(
                    onTap: () {},
                    mini: true,
                    buttonType: ButtonType.google,
                  ),
                  FlutterSocialButton(
                    onTap: () {},
                    mini: true,
                    buttonType: ButtonType.phone,
                  ),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。