copyWith method

ComponentConfig copyWith({
  1. ComponentType? type,
  2. Widget builder(
    1. BuildContext context
    )?,
  3. bool? isFloating,
  4. bool? isDraggable,
  5. bool? dragSnapToEdge,
  6. bool? hasAnimation,
  7. bool? isCollapsible,
  8. bool? initiallyExpanded,
  9. Duration? animationDuration,
  10. AnimationType? animationType,
  11. double? width,
  12. double? height,
  13. double? top,
  14. double? left,
  15. double? bottom,
  16. double? right,
  17. EdgeInsets? margin,
  18. EdgeInsets? padding,
  19. Map<String, dynamic>? customProps,
  20. Color? backgroundColor,
  21. bool? showToggleButton,
  22. bool? isShow,
})

复制并修改配置

Implementation

ComponentConfig copyWith({
  ComponentType? type,
  Widget Function(BuildContext context)? builder,
  bool? isFloating,
  bool? isDraggable,
  bool? dragSnapToEdge,
  bool? hasAnimation,
  bool? isCollapsible,
  bool? initiallyExpanded,
  Duration? animationDuration,
  AnimationType? animationType,
  double? width,
  double? height,
  double? top,
  double? left,
  double? bottom,
  double? right,
  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,
    isDraggable: isDraggable ?? this.isDraggable,
    dragSnapToEdge: dragSnapToEdge ?? this.dragSnapToEdge,
    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,
    top: top ?? this.top,
    left: left ?? this.left,
    bottom: bottom ?? this.bottom,
    right: right ?? this.right,
    margin: margin ?? this.margin,
    padding: padding ?? this.padding,
    customProps: customProps ?? this.customProps,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    showToggleButton: showToggleButton ?? this.showToggleButton,
    isShow: isShow ?? this.isShow,
  );
}