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
),