outlinedButton method

OutlinedButton outlinedButton({
  1. required void onPressed()?,
  2. void onLongPress()?,
  3. void onHover(
    1. bool
    )?,
  4. void onFocusChange(
    1. bool
    )?,
  5. ButtonStyle? style,
  6. FocusNode? focusNode,
  7. bool autofocus = false,
  8. Clip? clipBehavior,
  9. WidgetStatesController? statesController,
})

Creates an OutlinedButton with this widget as its child.

Outlined buttons are medium-emphasis buttons. They contain actions that are important but aren't the primary action in an app. Outlined buttons pair well with filled buttons to indicate an alternative, secondary action.

Parameters:

  • onPressed - Called when the button is pressed. If null, button is disabled.
  • onLongPress - Called when the button is long-pressed.
  • onHover - Called when a pointer enters or exits the button area.
  • onFocusChange - Called when the focus state of the button changes.
  • style - Customizes the button's appearance and behavior.
  • focusNode - An optional focus node to use as the focus node for this widget.
  • autofocus - Whether this widget should focus itself if nothing else is focused.
  • clipBehavior - The content will be clipped (or not) according to this option.
  • statesController - Represents the interactive state of the button.

Returns an OutlinedButton with this widget as its child.

Example:

Text('Cancel')
  .outlinedButton(
    onPressed: () => Navigator.pop(context),
    style: OutlinedButton.styleFrom(
      side: BorderSide(color: Colors.red),
    ),
  )

See also:

Implementation

OutlinedButton outlinedButton({
  required void Function()? onPressed,
  void Function()? onLongPress,
  void Function(bool)? onHover,
  void Function(bool)? onFocusChange,
  ButtonStyle? style,
  FocusNode? focusNode,
  bool autofocus = false,
  Clip? clipBehavior,
  WidgetStatesController? statesController,
}) =>
    OutlinedButton(
      onPressed: onPressed,
      onLongPress: onLongPress,
      onHover: onHover,
      onFocusChange: onFocusChange,
      style: style,
      focusNode: focusNode,
      autofocus: autofocus,
      clipBehavior: clipBehavior,
      statesController: statesController,
      child: this,
    );