FButton constructor

FButton({
  1. required VoidCallback? onPress,
  2. required Widget label,
  3. FButtonStyle style = Variant.primary,
  4. VoidCallback? onLongPress,
  5. bool autofocus = false,
  6. FocusNode? focusNode,
  7. ValueChanged<bool>? onFocusChange,
  8. Widget? prefix,
  9. Widget? suffix,
  10. Key? key,
})

Creates a FButton that contains a prefix, label, and suffix.

The button layout is as follows, assuming the locale is read from left to right:

|---------------------------------------|
|  [prefixIcon]  [label]  [suffixIcon]  |
|---------------------------------------|

FButtonIcon provides a convenient way to transform a bundled SVG icon into a prefix and suffix.

Implementation

FButton({
  required this.onPress,
  required Widget label,
  this.style = Variant.primary,
  this.onLongPress,
  this.autofocus = false,
  this.focusNode,
  this.onFocusChange,
  Widget? prefix,
  Widget? suffix,
  super.key,
}) : child = Content(
        prefix: prefix,
        suffix: suffix,
        label: label,
      );