DynamicComponent class abstract
支持参数传递的动态化组件。
主要原理是在导出的json中,标记特殊字段,在解析时,将字段替换为实际参数,再交由 DynamicWidgetBuilder
解析为静态 Widget。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- DynamicComponent
- Available Extensions
Constructors
Properties
-
data
→ Map<
String, dynamic> ? -
业务数据
final
-
dataRelation
→ Map<
String, dynamic> ? -
关系表,导出用
no setter
- dslInfo → DSLInfo?
-
DSL数据,最好优化成从缓存获取, 仅 release 模式,或
kTestDSL
== true 时会使用no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- initialWidget → Widget?
-
如果不加这个,在DSL模式下,在列表中滚动会抖屏,建议传入一个简单组件,否则会影像性能
final
- isDSL → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDslSize → (dynamic Function(double width, double height)?)
-
当 DSL 生成成功后回调 DSL 尺寸
final
- onTap → OnTap?
-
本组件中所有 TapDetctor 被点击时,会将 TapDetctor.event 回调到 onTap 中
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widgetType → String
-
====================== 下面是导出时才有用 ======================
组件名称
no setter
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
buildWidget(
BuildContext context) → Widget - 只有开发模式会走到这里
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
exportJson(
BuildContext context) → Map< String, dynamic> -
localBuild(
BuildContext context) → Widget -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited