copyWith static method
Widget
copyWith({
- Key? key,
- required Widget child,
- IconThemeData? iconThemeData,
- double? itemHeight,
- double? minMenuWidth,
- double? maxMenuWidth,
- TextStyle? textStyle,
- Color? selectedColor,
- Color? selectedHighlightColor,
- Color? selectedHoverColor,
- Color? selectedForeground,
- Color? hoverColor,
- Color? highlightColor,
- Color? background,
- Color? color,
Makes a copy of the nearest ContextMenuTheme overwriting selected fields.
Implementation
static Widget copyWith({
Key? key,
required Widget child,
IconThemeData? iconThemeData,
double? menuWidthStep,
double? itemHeight,
double? minMenuWidth,
double? maxMenuWidth,
double? menuHorizontalPadding,
TextStyle? textStyle,
Color? selectedColor,
Color? selectedHighlightColor,
Color? selectedHoverColor,
Color? selectedForeground,
Color? hoverColor,
Color? highlightColor,
Color? background,
Color? color,
}) {
return Builder(
key: key,
builder: (context) => ContextMenuTheme(
data: ContextMenuTheme.of(context).copyWith(
iconThemeData: iconThemeData,
menuWidthStep: menuWidthStep,
itemHeight: itemHeight,
minMenuWidth: minMenuWidth,
maxMenuWidth: maxMenuWidth,
menuHorizontalPadding: menuHorizontalPadding,
textStyle: textStyle,
selectedColor: selectedColor,
selectedHighlightColor: selectedHighlightColor,
selectedHoverColor: selectedHoverColor,
selectedForeground: selectedForeground,
hoverColor: hoverColor,
highlightColor: highlightColor,
background: background,
color: color,
),
child: child,
),
);
}