DropdownTreeMenu<T, E> class
This widget is just like this: ----------------|--------------------- MainItem1 |SubItem1 MainItem2 |SubItem2
MainItem3 | SubItem3 |
---|---|
When you tap "MainItem1", the sub list of this widget will |
- call
getSubData(widget.data[0])
, this will return a list of data for sub list - Refresh the sub list of the widget by using the list above.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DropdownWidget
- DropdownTreeMenu
Constructors
-
DropdownTreeMenu({Key? key, required List<
T> data, double? itemExtent, int? selectedIndex, required MenuItemBuilder<T> itemBuilder, double? subItemExtent, required MenuItemBuilder<E> subItemBuilder, required GetSubData<T, E> getSubData, Color? background = const Color(0xfffafafa), Color? subBackground, int flex = 1, int subFlex = 2, int? subSelectedIndex, }) -
const
Properties
- background → Color?
-
background for main list
final
- controller → DropdownMenuController?
-
finalinherited
-
data
→ List<
T> -
data from this widget
final
- flex → int
-
flex for main list
final
-
getSubData
→ GetSubData<
T, E> -
A callback to get sub list from left list data, eg.
When you set List
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
itemBuilder
→ MenuItemBuilder<
T> -
item builder for main list
final
- itemExtent → double?
-
itemExtent
of main listfinal - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedIndex → int?
-
selected index of main list
final
- subBackground → Color?
-
background for sub list
final
- subFlex → int
-
flex for sub list,
if
subFlex
==2 andflex
==1,then sub list will be 2 times larger than main listfinal -
subItemBuilder
→ MenuItemBuilder<
E> -
A function to build right item of the tree
final
- subItemExtent → double?
-
itemExtent
of sub listfinal - subSelectedIndex → int?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → DropdownState< DropdownWidget> -
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}) → 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