DynamicModel class

js端传输过来的jsonData转换为的model 具有层级关系,可以递归查找

Constructors

DynamicModel.create(Map<String, dynamic> widgetModel, {BuildContext context, DynamicModel parentModel})

Properties

buildProps Map<String, dynamic>
props的属性为DynamicModel时构建出的值
read / write
controller ↔ dynamic
read / write
dynamicWidget DynamicWidget
当前model构建出的动态组件
read / write
dynamicWidgetState DynamicWidgetState
持有当前stateful model对应widget实例的state,当页面render时赋值
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
isStateful bool
当前model对应的widget是否是stateful
read / write
key Key
当前model对应的widget的key
read / write
name String
widgetName
read / write
pageName String
所属页面名称
read / write
parent DynamicModel
read / write
props Map<String, dynamic>
当前widget对应的props
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
widgetId String
widgetId
read / write
widgetInstance DFBasicWidget
持有动态组件内部的组件实例
read / write

Methods

buildDynamicWidget({BuildContext context, String propKeyInParentModel, bool propIsArray = false, bool isInListViewBuilder = false}) Widget
构建组件实例 isInListViewBuilder 如果该方法是在 ListView.itemBuilder 中调用,则构建完成后直接返回,不需要其他操作
findNearlyStatefulModel() DynamicModel
向上查找最近的 stateful model 未使用到
merge(DynamicModel newModel) → void
将新model中的属性合并到当前model中 为了实现局部更新
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setWidgetState(DynamicWidgetState state) → void
更新当前model的widget state
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Properties

controllers Map<String, Map<String, dynamic>>
以页面为单位缓存所有的 controller
read / write

Static Methods

findTargetModels({DynamicModel aimModel, String aimWidgetId, FindModelCallback findCallback}) List<DynamicModel>
查找指定的 widgets
isModelList(dynamic data) bool
判断当前 List 中的元素是否是 DynamicModel 或者能够用来构建 DynamicModel
isModelMap(dynamic data) bool
判断当前 Map 是否可以用来构建 DynamicModel