ContextMenuButton<T>.filled constructor
ContextMenuButton<T>.filled (
- String text, {
- Key? key,
- double? fontSize,
- String? tooltip,
- EdgeInsets? padding,
- FocusNode? focusNode,
- bool canRequestFocus = true,
- bool autofocus = false,
- bool enableAnimation = false,
- bool willChangeState = false,
- VoidCallback? onLongPress,
- ButtonThemeData? theme,
- T? value,
- ContextMenuCanceled? onCanceled,
- required ContextMenuItemSelected<
T> ? onSelected, - required ContextMenuItemBuilder<
T> itemBuilder,
Creates a button with a filled background.
Implementation
factory ContextMenuButton.filled(
String text, {
Key? key,
double? fontSize,
String? tooltip,
EdgeInsets? padding,
FocusNode? focusNode,
bool canRequestFocus = true,
bool autofocus = false,
bool enableAnimation = false,
bool willChangeState = false,
VoidCallback? onLongPress,
ButtonThemeData? theme,
T? value,
ContextMenuCanceled? onCanceled,
required ContextMenuItemSelected<T>? onSelected,
required ContextMenuItemBuilder<T> itemBuilder,
}) {
return ContextMenuButton(
key: key,
padding: padding,
bodyPadding: padding != null ? EdgeInsets.zero : null,
theme: theme,
tooltip: tooltip,
onLongPress: onLongPress,
focusNode: focusNode,
canRequestFocus: canRequestFocus,
autofocus: autofocus,
filled: true,
willChangeState: willChangeState,
enableAnimation: enableAnimation,
value: value,
itemBuilder: itemBuilder,
onCanceled: onCanceled,
onSelected: onSelected,
body: Text(
text,
style: fontSize != null ? TextStyle(fontSize: fontSize) : null,
),
);
}