CxSelectButtonList class
Select Button List
It likes that select item of the video play list in the video play page of tencent video website.
the data and onChange of the component are required properties.
the type of data is List. the subtype of List is String.
the onChange is event. the event can be called after the data item widget is clicked.
three types of parameters of the component. they are box, item and action. the box: size, boxColor, margin, padding. the item: fontSize, color, selectColor, bgColor, selectBgColor, defaultSelect, minWidth the action: hasTopRight, topRight.
{@tool snippet}
CxSelectButtonList(
boxColor: Colors.transparent,
bgColor: Colors.primary.withAlpha(200),
selectBgColor: Colors.primary,
size: 50,
data: const <String>["1", "2", "3", "4", "5", "6", "7", "8", "9"],
onChange: (index, item) {
// print("$index $item");
},
);
{@end-tool}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CxSelectButtonList
Constructors
-
CxSelectButtonList({Key? key, required List<
String> data, required Function onChange, double? size, Color? boxColor = Colors.transparent, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, double? fontSize, Color? color = Colors.white, Color? selectColor = Colors.white, Color? bgColor = Colors.blue, Color? selectBgColor = Colors.green, int? defaultSelect = 0, double? minWidth, List<int> ? hasTopRight, Widget? topRight}) -
const
Properties
- bgColor → Color?
-
the background color of the items
final
- boxColor → Color?
-
the component background color.
final
- color → Color?
-
the font color of the items.
final
-
data
→ List<
String> -
the data list to show.
final
- defaultSelect → int?
-
default select index. Default is
0.final - fontSize → double?
-
the font size of the items. Default is
14.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
hasTopRight
→ List<
int> ? -
are top right widgets show?
the item is index of the data. default is
false.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsetsGeometry?
-
the component margin.
final
- minWidth → double?
-
the min width of the items. Default is
50.final - onChange → Function
-
the select index is changed to response.
final
- padding → EdgeInsetsGeometry?
-
the component padding.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectBgColor → Color?
-
the background color of the select item.
final
- selectColor → Color?
-
the font color of the select item.
final
- size → double?
-
height of the component. Default is
60.final - topRight → Widget?
-
top right widget.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CxSelectButtonList> -
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