搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。