BrnSelectionEntity class

筛选组件使用的数据结构

Constructors

BrnSelectionEntity({String? key, String? value, String? defaultValue, String title = '', String? subTitle, List<BrnSelectionEntity> children = const [], bool isSelected = false, Map extMap = const {}, Map<String, String>? customMap, String? type, String? showType, bool isCustomTitleHighLight = false, int maxSelectedCount = BrnSelectionConstant.maxSelectCount})
BrnSelectionEntity.fromJson(Map? map)
BrnSelectionEntity.simple({String? key, String? value, String title = '', String? type})
构造简单筛选数据

Properties

canJoinTitle bool
临时字段用于判断是否要将筛选项 name 字段拼接展示
getter/setter pair
children List<BrnSelectionEntity>
子筛选项
getter/setter pair
customMap Map<String, String>?
自定义输入
getter/setter pair
customTitle String?
自定义标题
getter/setter pair
defaultValue String?
默认值
getter/setter pair
extMap Map
扩展字段,目前只有min和max
getter/setter pair
filterShowType BrnSelectionWindowType?
筛选弹窗展示风格,具体参见 BrnSelectionWindowType
getter/setter pair
filterType BrnSelectionFilterType
筛选类型,具体参见 BrnSelectionFilterType
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
isCustomTitleHighLight bool
自定义筛选的 title 是否高亮
getter/setter pair
isSelected bool
///////// 以上为接口下发的原始数据字段 /////////////// ///////// 下方为组件另需要使用的字段 /////////////// 是否选中
getter/setter pair
key String?
回传给服务器的 key
getter/setter pair
maxSelectedCount int
最大可选数量
getter/setter pair
originalCustomMap Map
用于临时存储原有自定义字段数据,在筛选数据变化后未点击【确定】按钮时还原。
getter/setter pair
parent BrnSelectionEntity?
父级筛选项
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showType String?
筛选弹窗展示风格对应的首字母小写的字符串,例如 rangelist,参见 BrnSelectionWindowType
getter/setter pair
subTitle String?
显示的文案
getter/setter pair
title String
显示的文案
getter/setter pair
type String?
类型 是单选、复选还是有自定义输入
getter/setter pair
value String?
回传给服务器的 value
getter/setter pair

Methods

allSelectedList() List<BrnSelectionEntity>
获取当前节点的所有选中的子节点
clearChildSelection() → void
清空子节点的选中状态
clearSelectedEntity() → void
递归清空选中状态
configDefaultValue() → void
configRelationship() → void
configRelationshipAndDefaultValue() → void
currentDefaultTagCountForEntity() int
最终显示tag个数
currentRangeListForEntity() List<BrnSelectionEntity>
返回当前节点下所有以下类型的子节点 BrnSelectionFilterType.range BrnSelectionFilterType.dateRange BrnSelectionFilterType.dateRangeCalendar
currentShowTagByExpanded(bool isExpanded) List<BrnSelectionEntity>
根据是否展开,返回对应数量的子节点
currentTagListForEntity() List<BrnSelectionEntity>
返回当前节点所有不是以下类型的子节点 BrnSelectionFilterType.range BrnSelectionFilterType.dateRange BrnSelectionFilterType.dateRangeCalendar
getDefaultShowCount() int
接口返回默认展示tag个数
getFirstSelectedChildIndex() int
获取第一个选中的子节点的下标
getIndexInCurrentLevel() int
判断当前的筛选 Item 是否为当前层次中第一个被选中的 Item。 用于展开筛选弹窗时显示选中效果。
getLimitedRootMaxSelectedCount() int
获取当前节点对应根节点,可选择的最大选中数量
getLimitedRootSelectedChildCount() int
获取当前节点对应根节点,返回根节点最后一级选中的子节点的数量
getRootEntity(BrnSelectionEntity rootEntity) BrnSelectionEntity
获取当前节点对应根节点
getSelectedChildCount(BrnSelectionEntity entity) int
返回最后一层级【选中状态】 Item 的 个数
hasCheckBoxBrother() bool
检查自己的兄弟结点是否存在 checkbox 类型。
isInLastLevel() bool
是否在筛选数据的最后一层。 如果最大层次为 3;某个筛选数据层次为 2,但其无子节点。此时认为不在最后一层。
isOverCurrentTagListSize() bool
默认展示个数是否大于总tag个数
isUnLimit() bool
在这里简单认为 value 为空【null 或 ''】时为 unlimit.
isValidRange() bool
校验 range 类型的数据是否合法
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parserFilterTypeWithType(String? type) BrnSelectionFilterType
根据 type 解析出对应的 BrnSelectionFilterType, 默认为 BrnSelectionFilterType.none
parserShowType(String? showType) BrnSelectionWindowType
根据 showType 解析出对应的 BrnSelectionWindowType, 默认为 BrnSelectionWindowType.list
reverseSelected() → void
反选
selectedLastColumnList() List<BrnSelectionEntity>
获取当前节点的所有选中的子节点
selectedList() List<BrnSelectionEntity>
获取当前节点的所有选中的子节点,支持 more 类型
selectedListWithoutUnlimit() List<BrnSelectionEntity>
获取当前节点的所有选中的子节点, 不包含【不限】节点
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromMap(Map<String, dynamic> map) BrnSelectionEntity
建议使用 BrnSelectionEntity.fromJson