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

auth_buttons 封面
插件详情v3.0.3

auth_buttons

Auth Buttons 是一个 Flutter 小部件库,包含用于通过最受欢迎的社交网络(如 Google、Facebook、Apple 和 Twitter)进行身份验证的按钮。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4210
喜欢数
199
Pub 分数
140

安装插件

flutter pub add auth_buttons

插件介绍

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

Auth Buttons 是一个 Flutter 小部件库,提供可用于 Google、Facebook、Apple 和 Twitter 等热门社交网络的即用型认证按钮。该库旨在简化社交登录功能的集成,跨平台提供一致且视觉上吸引人的按钮。该包支持 Android、iOS、Web、macOS、Windows 和 Linux,确保跨平台兼容性。通过减少样板代码并简化第三方认证流程的实现,它提升了用户体验。

适合场景

  • 社交登录集成
  • 使用社交账户进行用户引导
  • 跨平台身份验证 UI
  • 简化版 OAuth 按钮实现
  • 简化登录流程

主要特点

  • 预构建的社交登录按钮
  • 支持 Google、Facebook、Apple 和 Twitter
  • 跨平台兼容性
  • 跨设备的一致性用户界面
  • 轻松集成,设置简单
  • 可自定义的按钮样式

适合对象

  • 使用社交登录开发应用程序的开发者
  • 需要快速身份验证UI组件的项目
  • 针对多个平台的应用
  • 注重开发速度的团队
  • 面向前端的认证实现

使用建议

  • OAuth 设置需要额外配置
  • 依赖于底层平台 SDK
  • 可能需要为错误状态自定义处理
  • 仅限预定义的社交提供商
  • 不适用于自定义身份验证方法

原始 README

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

auth_buttons

Github stars Pub Version

Auth Buttons is a flutter widget library, include buttons for authenticating with the most popular social networks like: Google, Facebook, Apple and too other.

Installation

  1. Add this to your packages pubspec.yaml file:
dependencies:
  auth_buttons: <^last>
  1. Install it You can install it from the command line:
$ flutter pub get
  1. Import it Now in Dart code, you can use:
import 'package:auth_buttons/auth_buttons.dart';

Recommendation

We recommend you to using show special when you want use some button. show help you importing part of library.

import 'package:auth_buttons/auth_buttons.dart'
    show GoogleAuthButton, AuthButtonStyle, AuthButtonType, AuthIconType;

We also recommend you to using the latest version.

Overview

From the version 3.0.0 all AuthButtons are following the system mode. see ThemeMode for more info.

From the version 3.0.0 you're able to regroup AuthButton s for sharing style properties, to do this use the already existing AuthButtonGroup.

From the version 2.0.0 disabled state is supported.

  1. Enabled
  2. Disabled

There are three Types you can choose between them:

  1. Default
  2. Icon
  3. Secondary

Suggestion

If you plain to use a non existing AuthButton like: Linkedin or any others along with the existing one, than make your custom one just use CustomAuthButton this provide you with a fast way to do so.

Using

Enabled State.

You need to use just the following code:

Default Type
GoogleAuthButton(
  onPressed: () {},
),
Light Dark
default-button-default-icon dark-default-button-default-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    iconType: AuthIconType.outlined,
  ),
),
Light Dark
default-button-outlined-icon dark-default-button-outlined-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    iconType: AuthIconType.secondary,
  ),
),
Light Dark
default-button-secondary-icon dark-default-button-secondary-icon
Icon Type
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.icon,
  ),
),
Light Dark
icon-button-default-icon dark-icon-button-default-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.icon,
    iconType: AuthIconType.outlined,
  ),
),
Light Dark
icon-button-outlined-icon dark-icon-button-outlined-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.icon,
    iconType: AuthIconType.secondary,
  ),
),
Light Dark
icon-button-secondary-icon dark-icon-button-secondary-icon
Secondary Type
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.secondary,
  ),
),
Light Dark
secondary-button-default-icon dark-secondary-button-default-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.secondary,
    iconType: AuthIconType.outlined,
  ),
),
Light Dark
secondary-button-outlined-icon dark-secondary-button-outlined-icon
GoogleAuthButton(
  onPressed: () {},
  style: AuthButtonStyle(
    buttonType: AuthButtonType.secondary,
    iconType: AuthIconType.secondary,
  ),
),
Light Dark
secondary-button-secondary-icon dark-secondary-button-secondary-icon
Disabled State
Light Dark
disabled-buttons dark-disabled-buttons

Do same think with the other buttons, when you want to customize any button you can do it just passing a property which you want.

Grouped buttons

Example

auth button group usecase
AuthButtonGroup(
  style: const AuthButtonStyle(
    width: 180,
    height: 50,
    borderColor: Colors.purple,
    borderWidth: 3.0,
    margin: EdgeInsets.only(bottom: 8.0),
  ),
  buttons: [
    GoogleAuthButton(),
    AppleAuthButton(),
    //....
  ]
),
                                                                                           Secondary                                                                                               |  Icon

:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------: auth button group secondary buttons | auth-button-group-icon-buttons

Full property you can pass:

GoogleAuthButton(
  key: const ValueKey<String>(''),
  onPressed: () {},
  onLongPress: () {},
  onHover: (bool value) {},
  onFocusChange: (bool value) {},
  focusNode: FocusNode(),
  autofocus: false,
  text: 'Sign in with Google',
  isLoading: false,
  themeMode: ThemeMode.system,
  textDirection: TextDirection.ltr,
  materialStyle: ButtonStyle(),
  style: AuthButtonStyle(
    buttonColor: Colors.blue,
    splashColor: Colors.red,
    elevation: 2.0,
    borderRadius: 99.0,
    textStyle: TextStyle(),
    padding: const EdgeInsets.all(8.0),
    margin: const EdgeInsets.all(8.0),
    borderColor: Colors.amber,
    borderWidth: 3.0,
    buttonType: AuthButtonType.secondary,
    width: 300.0,
    height: 50.0,
    iconSize: 40.0,
    separator: 20.0,
    iconBackground: Colors.white,
    iconType: AuthIconType.outlined,
    shadowColor: Colors.pink,
    progressIndicatorColor: Colors.blue,
    progressIndicatorValueColor: Colors.grey[300],
    progressIndicatorStrokeWidth: 2.0,
    progressIndicatorValue: 1.0,
    iconColor: Colors.purple,
    progressIndicatorType: AuthIndicatorType.circular,
    visualDensity: VisualDensity.standard,
    tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),

return up

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。