登录按钮

一个 Flutter 插件,用于为不同的社交媒体账户生成登录按钮。

入门

您必须将库添加为项目的依赖项。

dependencies:
 sign_button: ^1.0.1

然后您应该运行 flutter packages get

现在,在您的 Dart 代码中,您可以使用

import 'package:sign_button/sign_button.dart'

用法示例

非常简单!

SignInButton(
  buttonType: ButtonType.google,
  onPressed: () {
   print('click');
  })

btns

按钮大小

SignInButton(
  buttonType: ButtonType.google,
  buttonSize: ButtonSize.large, // small(default), medium, large
  onPressed: () {
   print('click');
  })

size

图片位置

SignInButton(
  imagePosition: ImagePosition.left, // left or right
  buttonType: ButtonType.google,
  onPressed: () {
   print('click');
  })

position

自定义按钮

SignInButton(
 buttonType: ButtonType.pinterest,
 imagePosition: ImagePosition.right,
 //[buttonSize] You can also use this in combination with [width]. Increases the font and icon size of the button.
 buttonSize: ButtonSize.large,
 btnTextColor: Colors.grey,
 btnColor: Colors.white,
 width: 140,
 //[width] Use if you change the text value.
 btnText: 'Pinterest',
 onPressed: () {
  print('click');
 })

custom

迷你按钮

SignInButton.mini(
 buttonType: ButtonType.github,
 onPressed: () {},
),

mini_button

其他属性

  • 按钮文本
  • 按钮颜色
  • 按钮文本颜色
  • elevation
  • shape
  • 宽度 // 当文本大小变得太小时,您可以更改宽度值。
  • 内边距 // 内边距值会根据按钮大小自动调整。如果您愿意,可以给出值

GitHub

https://github.com/emreesen27/Flutter-Sign-in-Button