ContextMenuButton<T>.icon constructor
ContextMenuButton<T>.icon (
- IconData icon, {
- Key? key,
- String? tooltip,
- double? size,
- EdgeInsets? padding,
- FocusNode? focusNode,
- bool canRequestFocus = true,
- bool autofocus = 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 icon.
Implementation
factory ContextMenuButton.icon(
IconData icon, {
Key? key,
String? tooltip,
double? size,
EdgeInsets? padding,
FocusNode? focusNode,
bool canRequestFocus = true,
bool autofocus = 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,
tooltip: tooltip,
onLongPress: onLongPress,
focusNode: focusNode,
canRequestFocus: canRequestFocus,
autofocus: autofocus,
willChangeState: willChangeState,
enableAnimation: true,
filled: false,
theme: theme,
value: value,
itemBuilder: itemBuilder,
onCanceled: onCanceled,
onSelected: onSelected,
body: Icon(icon, size: size),
);
}