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

插件详情v1.0.7

social_login_buttons

一个全新的 Flutter 包,可让用户轻松创建社交媒体登录按钮。

AndroidiOSLinuxmacOSWebWindows
近 30 天下载
1210
喜欢数
56
Pub 分数
150

安装插件

flutter pub add social_login_buttons

插件介绍

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

一个 Flutter 包,可简化社交媒体登录按钮的创建,使开发者能够快速将 Google、Facebook 和 Apple 等流行社交登录集成到其应用中。该包提供预设计且可自定义的按钮,并在各平台上保持一致的样式。该包支持 Android、iOS、Web 和桌面环境等多种平台,确保用户获得无缝体验。通过最少的设置,它通过提供熟悉且视觉上吸引人的登录选项来增强应用的入门流程。

适合场景

  • 快速集成社交登录
  • 增强用户入门体验
  • 跨平台身份验证
  • 简化登录UI设计
  • 支持多个社交提供商
  • 减少样板代码

主要特点

  • 预构建的社交登录按钮
  • 可自定义的按钮样式
  • 多平台支持
  • 通过最少的代码实现轻松设置
  • 跨设备的一致性用户界面
  • 内置提供者图标

适合对象

  • 移动应用开发者
  • Web 应用程序创建者
  • 桌面应用程序集成商
  • 需要快速登录实现的初创企业
  • 专注于用户体验/用户界面效率的开发者

使用建议

  • 每个社交提供商都需要额外的配置
  • 可能需要为 OAuth 流程自定义处理
  • 限于预定义的按钮设计
  • 依赖外部提供方 API
  • 不适用于复杂的认证工作流
  • 登录期间需要互联网连接

原始 README

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

pub package pub points

Flutter Social Login Button

Social Login Button is a flutter package to create social media login buttons of all common used SSO.

Usage

Add the dependency in pubsec.yaml file.

  dependencies:
    flutter:
      sdk: flutter
    social_login_buttons: 1.0.7

How to Use

  SocialLoginButton(
    buttonType: SocialLoginButtonType.apple,
    onPressed: () {},
  )          

You can also specify some other arguments which are:

  • imageURL (if you're specifying the image link from your Github repo, don't forget to change blob with raw)
  • imagePath (you can also use local image, Local will be preferred incase cpecifed both)
  • imageWidth
  • text
  • backgroundColor
  • textColor
  • height
  • width
  • borderRadius
  • fontSize
  • mode

Below is the example with all arguments supplied:

   SocialLoginButton(
      backgroundColor: Colors.amber,
      height: 50,
      text: 'SignIn',
      borderRadius: 20,
      fontSize: 25,
      buttonType: SocialLoginButtonType.generalLogin,
      imageWidth: 20,
      imagepath: "assets/file.png",
      imageURL: "URL",
      onPressed: () {},
   ),

Button Types

  • Facebook
  • Google
  • Twitter
  • Apple
  • AppleBlack
  • Microsoft
  • MicrosoftBlack
  • Github
  • General Login

Mode

There are two modes available for the buttons, You can make shorter buttons with single mode.

  • single
  • multi

Example

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Social Login Buttons',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(tittle: 'Flutter Social Login Buttons'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key, required this.tittle}) : super(key: key);
  final String tittle;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Social Login Button'),
        elevation: 2.0,
      ),
      body: _buildContainer(context),
      backgroundColor: Colors.grey[200],
    );
  }

  Widget _buildContainer(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(16.0),
      child: Center(
        child: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              SocialLoginButton(
                buttonType: SocialLoginButtonType.apple,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.appleBlack,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.facebook,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.github,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.google,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.microsoft,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                buttonType: SocialLoginButtonType.microsoftBlack,
                onPressed: () {},
                imageWidth: 20,
              ),
              const SizedBox(height: 10),
              SocialLoginButton(
                backgroundColor: Colors.amber,
                height: 50,
                text: 'SignIn',
                borderRadius: 20,
                fontSize: 25,
                buttonType: SocialLoginButtonType.generalLogin,
                onPressed: () {},
              ),
              const SizedBox(height: 10),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  SocialLoginButton(
                    buttonType: SocialLoginButtonType.google,
                    onPressed: () {},
                    mode: SocialLoginButtonMode.single,
                  ),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}

Contributing

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

License

Apache-2.0

Screenshot

Image

所属分类

源码仓库

使用此插件的项目

暂无相关数据。