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