CustomAuthButton constructor

CustomAuthButton({
  1. required AuthIcon authIcon,
  2. Key? key,
  3. VoidCallback? onPressed,
  4. VoidCallback? onLongPress,
  5. ValueChanged<bool>? onHover,
  6. ValueChanged<bool>? onFocusChange,
  7. FocusNode? focusNode,
  8. bool? autofocus,
  9. String? text,
  10. @Deprecated('Use ThemeMode instead. ' 'This property has no more effect. ' 'This feature was deprecated after v3.0.0') bool darkMode = false,
  11. @Deprecated('Use TextDirection instead. ' 'This property has no more effect. ' 'This feature was deprecated after v3.0.0') bool rtl = false,
  12. bool isLoading = false,
  13. AuthButtonStyle style = const AuthButtonStyle(),
  14. ButtonStyle? materialStyle,
  15. ThemeMode themeMode = ThemeMode.system,
  16. TextDirection textDirection = TextDirection.ltr,
})

Implementation

CustomAuthButton({
  required this.authIcon,
  super.key,
  super.onPressed,
  super.onLongPress,
  super.onHover,
  super.onFocusChange,
  super.focusNode,
  super.autofocus,
  super.text,
  @Deprecated(
    'Use ThemeMode instead. '
    'This property has no more effect. '
    'This feature was deprecated after v3.0.0',
  )
  bool darkMode = false,
  @Deprecated(
    'Use TextDirection instead. '
    'This property has no more effect. '
    'This feature was deprecated after v3.0.0',
  )
  bool rtl = false,
  super.isLoading = false,
  super.style,
  super.materialStyle,
  super.themeMode,
  super.textDirection,
}) : assert(
        (style.buttonType != AuthButtonType.icon)
            ? text != null && text.isNotBlank
            : text == null,
        (style.buttonType != AuthButtonType.icon)
            ? 'Text must be not blank.'
            : 'Icon button type does not need a text.',
      );