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