FlatButton constructor Null safety

  1. @Deprecated('Use TextButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). ' 'This feature was deprecated after v1.26.0-18.0.pre.')
const FlatButton(
  1. {Key? key,
  2. required VoidCallback? onPressed,
  3. VoidCallback? onLongPress,
  4. ValueChanged<bool>? onHighlightChanged,
  5. MouseCursor? mouseCursor,
  6. ButtonTextTheme? textTheme,
  7. Color? textColor,
  8. Color? disabledTextColor,
  9. Color? color,
  10. Color? disabledColor,
  11. Color? focusColor,
  12. Color? hoverColor,
  13. Color? highlightColor,
  14. Color? splashColor,
  15. Brightness? colorBrightness,
  16. EdgeInsetsGeometry? padding,
  17. VisualDensity? visualDensity,
  18. ShapeBorder? shape,
  19. Clip clipBehavior = Clip.none,
  20. FocusNode? focusNode,
  21. bool autofocus = false,
  22. MaterialTapTargetSize? materialTapTargetSize,
  23. required Widget child,
  24. double? height,
  25. double? minWidth}
)

Create a simple text button.

The autofocus and clipBehavior arguments must not be null.

Implementation

@Deprecated(
  'Use TextButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). '
  'This feature was deprecated after v1.26.0-18.0.pre.',
)
const FlatButton({
  Key? key,
  required VoidCallback? onPressed,
  VoidCallback? onLongPress,
  ValueChanged<bool>? onHighlightChanged,
  MouseCursor? mouseCursor,
  ButtonTextTheme? textTheme,
  Color? textColor,
  Color? disabledTextColor,
  Color? color,
  Color? disabledColor,
  Color? focusColor,
  Color? hoverColor,
  Color? highlightColor,
  Color? splashColor,
  Brightness? colorBrightness,
  EdgeInsetsGeometry? padding,
  VisualDensity? visualDensity,
  ShapeBorder? shape,
  Clip clipBehavior = Clip.none,
  FocusNode? focusNode,
  bool autofocus = false,
  MaterialTapTargetSize? materialTapTargetSize,
  required Widget child,
  double? height,
  double? minWidth,
}) : assert(clipBehavior != null),
     assert(autofocus != null),
     super(
       key: key,
       height: height,
       minWidth: minWidth,
       onPressed: onPressed,
       onLongPress: onLongPress,
       onHighlightChanged: onHighlightChanged,
       mouseCursor: mouseCursor,
       textTheme: textTheme,
       textColor: textColor,
       disabledTextColor: disabledTextColor,
       color: color,
       disabledColor: disabledColor,
       focusColor: focusColor,
       hoverColor: hoverColor,
       highlightColor: highlightColor,
       splashColor: splashColor,
       colorBrightness: colorBrightness,
       padding: padding,
       visualDensity: visualDensity,
       shape: shape,
       clipBehavior: clipBehavior,
       focusNode: focusNode,
       autofocus: autofocus,
       materialTapTargetSize: materialTapTargetSize,
       child: child,
    );