CustomComponentConfig class
自定义组件配置类
- Inheritance
-
- Object
- ComponentConfig
- CustomComponentConfig
Constructors
-
CustomComponentConfig({required Widget builder(BuildContext context), double? top, double? left, double? bottom, double? right, bool isDraggable = false, bool dragSnapToEdge = false, bool hasAnimation = false, bool isCollapsible = false, bool initiallyExpanded = true, Duration animationDuration = const Duration(milliseconds: 300), AnimationType? animationType, double? width, double? height, EdgeInsets? margin, EdgeInsets? padding, Map<
String, dynamic> ? customProps, bool showToggleButton = true, bool isShow = true}) -
const
-
CustomComponentConfig.fromJson(Map<
String, dynamic> json, {required Widget builder(BuildContext context)}) -
从 JSON 创建 CustomComponentConfig 实例
注意:builder 无法从 JSON 反序列化,需要在创建后手动设置
factory
Properties
- animationDuration → Duration
-
finalinherited
- animationType → AnimationType?
-
finalinherited
- backgroundColor → Color?
-
finalinherited
- bottom → double?
-
finalinherited
- builder → Widget Function(BuildContext context)?
-
finalinherited
-
customProps
→ Map<
String, dynamic> ? -
finalinherited
- dragSnapToEdge → bool
-
finalinherited
- hasAnimation → bool
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
finalinherited
- initiallyExpanded → bool
-
finalinherited
- isCollapsible → bool
-
finalinherited
- isDraggable → bool
-
finalinherited
- isFloating → bool
-
finalinherited
- isShow → bool
-
新增:是否显示该组件
finalinherited
- isValid → bool
-
验证配置有效性
no setterinherited
- left → double?
-
finalinherited
- margin → EdgeInsets?
-
finalinherited
- padding → EdgeInsets?
-
finalinherited
- right → double?
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showToggleButton → bool
-
新增:是否显示切换按钮
finalinherited
- top → double?
-
finalinherited
- type → ComponentType?
-
finalinherited
- width → double?
-
finalinherited
Methods
-
copyWith(
{ComponentType? type, Widget builder(BuildContext context)?, 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}) → ComponentConfig -
复制并修改配置
inherited
-
mergeWith(
ComponentConfig patch) → ComponentConfig -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
转换为 JSON
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited