FButton constructor
FButton({
- required VoidCallback? onPress,
- required Widget label,
- FButtonStyle style = Variant.primary,
- VoidCallback? onLongPress,
- bool autofocus = false,
- FocusNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - Widget? prefix,
- Widget? suffix,
- 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 read from left to right:
|---------------------------------------|
| [prefixIcon] [label] [suffixIcon] |
|---------------------------------------|
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);