WeCascader<T> class
A dropdown that picks one path from a tree, after el-cascader.
The value is the list of option values from the root to the picked node. Only leaves can be picked unless checkStrictly is set, in which case a radio in front of every row picks that level.
WeCascader<String>(
value: _region,
onChanged: (path) => setState(() => _region = path),
options: const [
WeCascaderOption('zj', '浙江', children: [
WeCascaderOption('hz', '杭州', children: [
WeCascaderOption('xh', '西湖区'),
]),
]),
],
)
Platform: desktop and web (pointer + keyboard, wide screen). On phones prefer CascadeBottomSheet.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- WeCascader
Constructors
-
WeCascader({Key? key, required List<
WeCascaderOption< options, List<T> >T> ? value, required ValueChanged<List< ? onChanged, String? hint = '请选择', bool clearable = false, bool disabled = false, SizeEnum size = SizeEnum.defaultSize, double? width = 240, SemanticEnum? status, bool filterable = false, WeCascaderFilter<T> ?>T> ? filterMethod, bool checkStrictly = false, bool showAllLevels = true, String separator = ' / ', WeCascaderTrigger expandTrigger = WeCascaderTrigger.click, double columnWidth = 180, double columnHeight = 204, String noMatchText = '无匹配数据', String noDataText = '暂无数据'}) -
const
Properties
- checkStrictly → bool
-
Lets any level be picked, not only leaves.
final
- clearable → bool
-
final
- columnHeight → double
-
final
- columnWidth → double
-
final
- disabled → bool
-
final
- expandTrigger → WeCascaderTrigger
-
final
- filterable → bool
-
Type into the field to search every path by label.
final
-
filterMethod
→ WeCascaderFilter<
T> ? -
Replaces the default "any label contains the query" match.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hint → String?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- noDataText → String
-
final
- noMatchText → String
-
final
-
onChanged
→ ValueChanged<
List< ?T> ?> -
final
-
options
→ List<
WeCascaderOption< T> > -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
final
- showAllLevels → bool
-
Shows the whole path in the field;
falseshows only the last label.final - size → SizeEnum
-
final
- status → SemanticEnum?
-
Colours the border; a surrounding WeFormItem sets it on error.
final
-
value
→ List<
T> ? -
Values from the root down to the picked node.
final
- width → double?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< WeCascader< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
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, int wrapWidth = 65}) → 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