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
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:
// for full width Buttons//For default Button Its return a Email ButtonFlutterSocialButton(
onTap: () {}, ),
//For facebook Button FlutterSocialButton(
onTap: () {},
buttonType: ButtonType.facebook, // Button type for different type buttons
),
//For google ButtonFlutterSocialButton(
onTap: () {},
buttonType: ButtonType.google, // Button type for different type buttons
iconColor: Colors.black, // for change icons colors
),
// for Mini Circle ButtonFlutterSocialButton(
onTap: () {},
mini: true, //just pass true for mini circle buttons
buttonType: ButtonType.phone, // Button type for different type buttons
),