CustomAuthButton constructor Null safety

CustomAuthButton(
  1. {Key? key,
  2. VoidCallback? onPressed,
  3. VoidCallback? onLongPress,
  4. ValueChanged<bool>? onHover,
  5. ValueChanged<bool>? onFocusChange,
  6. FocusNode? focusNode,
  7. bool? autofocus,
  8. String? text,
  9. required AuthIcon authIcon,
  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({
  super.key,
  super.onPressed,
  super.onLongPress,
  super.onHover,
  super.onFocusChange,
  super.focusNode,
  super.autofocus,
  super.text,
  required this.authIcon,
  @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.',
      );