copyWith method
ComponentConfig
copyWith({
- ComponentType? type,
- Widget builder(
- BuildContext context
- bool? isFloating,
- bool? hasAnimation,
- bool? isCollapsible,
- bool? initiallyExpanded,
- Duration? animationDuration,
- AnimationType? animationType,
- double? width,
- double? height,
- EdgeInsets? margin,
- EdgeInsets? padding,
- Map<
String, dynamic> ? customProps, - Color? backgroundColor,
- bool? showToggleButton,
- bool? isShow,
复制并修改配置
Implementation
ComponentConfig copyWith({
ComponentType? type,
Widget Function(BuildContext context)? builder,
bool? isFloating,
bool? hasAnimation,
bool? isCollapsible,
bool? initiallyExpanded,
Duration? animationDuration,
AnimationType? animationType,
double? width,
double? height,
EdgeInsets? margin,
EdgeInsets? padding,
Map<String, dynamic>? customProps,
Color? backgroundColor,
bool? showToggleButton,
bool? isShow,
}) {
return ComponentConfig(
type: type ?? this.type,
builder: builder ?? this.builder,
isFloating: isFloating ?? this.isFloating,
hasAnimation: hasAnimation ?? this.hasAnimation,
isCollapsible: isCollapsible ?? this.isCollapsible,
initiallyExpanded: initiallyExpanded ?? this.initiallyExpanded,
animationDuration: animationDuration ?? this.animationDuration,
animationType: animationType ?? this.animationType,
width: width ?? this.width,
height: height ?? this.height,
margin: margin ?? this.margin,
padding: padding ?? this.padding,
customProps: customProps ?? this.customProps,
backgroundColor: backgroundColor ?? this.backgroundColor,
showToggleButton: showToggleButton ?? this.showToggleButton,
isShow: isShow ?? this.isShow,
);
}