Button constructor

const Button({
  1. Key? key,
  2. Widget? body,
  3. Widget? trailing,
  4. Widget? leading,
  5. String? tooltip,
  6. ButtonThemeData? theme,
  7. EdgeInsets? leadingPadding,
  8. EdgeInsets? padding,
  9. EdgeInsets? bodyPadding,
  10. EdgeInsets? trailingPadding,
  11. bool? active,
  12. VoidCallback? onLongPress,
  13. FocusNode? focusNode,
  14. bool canRequestFocus = true,
  15. bool autofocus = false,
  16. bool filled = false,
  17. required VoidCallback? onPressed,
  18. bool willChangeState = false,
  19. bool enableAnimation = true,
})

Creates a Button.

Implementation

const Button({
  super.key,
  this.body,
  this.trailing,
  this.leading,
  this.tooltip,
  this.theme,
  this.leadingPadding,
  this.padding,
  this.bodyPadding,
  this.trailingPadding,
  this.active,
  this.onLongPress,
  this.focusNode,
  this.canRequestFocus = true,
  this.autofocus = false,
  this.filled = false,
  required this.onPressed,
  this.willChangeState = false,
  this.enableAnimation = true,
}) : assert(body != null || trailing != null || leading != null);