SignInButton constructor

SignInButton(
  1. Buttons button, {
  2. required VoidCallback onPressed,
  3. bool mini = false,
  4. EdgeInsets? padding,
  5. ShapeBorder? shape,
  6. String? text,
  7. double? elevation,
  8. double? iconSize,
  9. double? fontSize,
  10. Color? backgroundColor,
  11. Color? textColor,
  12. Color? iconColor,
  13. Color? splashColor,
  14. Color? highlightColor,
  15. double? height,
  16. double? width,
  17. MainAxisAlignment? contentAlignment,
})

The constructor is fairly self-explanatory.

Implementation

SignInButton(
  this.button, {
  required this.onPressed,
  this.mini = false,
  EdgeInsets? padding,
  this.shape,
  String? text,
  double? elevation,
  double? iconSize,
  double? fontSize,
  Color? backgroundColor,
  Color? textColor,
  Color? iconColor,
  Color? splashColor,
  Color? highlightColor,
  this.height,
  this.width,
  MainAxisAlignment? contentAlignment,
}) {
  this.padding = padding ?? EdgeInsets.zero;
  this.elevation = elevation ?? 1.0;
  this.iconSize = iconSize ?? 14.0;
  this.fontSize = fontSize ?? 14.0;

  buttonDescriptor = buttonConfig.firstWhere((element) => element.type == button);

  this.textColor = textColor ?? defaultColor;
  this.iconColor = iconColor ?? defaultColor;
  this.splashColor = splashColor ?? defaultColor.withOpacity(0.3);
  this.backgroundColor =
      backgroundColor ?? (useProviderColors == true ? buttonDescriptor.backgroundColor : defaultBackgroundColor);
  this.highlightColor = highlightColor ?? this.backgroundColor!.withOpacity(0.3);
  this.text = text ?? buttonDescriptor.text;
  this.contentAlignment = contentAlignment ?? MainAxisAlignment.start;
}