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.

prefix and suffix are wrapped in FIconStyle, and therefore works with FIcons.

The button layout is as follows, assuming the locale is LTR:

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

The layout is reversed for RTL locales.

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);