Button constructor

const Button({
  1. Key? key,
  2. Widget? child,
  3. ButtonStateWidgetBuilder? builder,
  4. ButtonThemeData? style,
  5. VoidCallback? onPressed,
  6. VoidCallback? onLongPress,
  7. String? semanticLabel,
  8. FocusNode? focusNode,
  9. bool autofocus = false,
})

Creates a fluent-styled button.

You can't provide both child and builder, but you must provide at least one of them.

Implementation

const Button({
  Key? key,
  this.child,
  this.builder,
  this.style,
  this.onPressed,
  this.onLongPress,
  this.semanticLabel,
  this.focusNode,
  this.autofocus = false,
})  : assert(
        child != null || builder != null,
        'You can NOT provide both child and builder',
      ),
      type = _ButtonType.def,
      super(key: key);