NumberPicker class

Inheritance

Constructors

NumberPicker({Key? key, required int minValue, required int maxValue, required int value, required ValueChanged<int> onChanged, int itemCount = 3, int step = 1, double itemHeight = 50, double itemWidth = 100, Axis axis = Axis.vertical, TextStyle? textStyle, TextStyle? selectedTextStyle, bool haptics = false, Decoration? decoration, bool zeroPad = false, TextMapper? textMapper, bool infiniteLoop = false})
const

Properties

axis Axis
Direction of scrolling
final
decoration Decoration?
Decoration to apply to central box where the selected value is placed
final
haptics bool
Whether to trigger haptic pulses or not
final
hashCode int
The hash code for this object.
no setterinherited
infiniteLoop bool
final
itemCount int
Specifies how many items should be shown - defaults to 3
final
itemHeight double
height of single item in pixels
final
itemWidth double
width of single item in pixels
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxValue int
Max value user can pick
final
minValue int
Min value user can pick
final
onChanged ValueChanged<int>
Called when selected value changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedTextStyle TextStyle?
Style of non-selected numbers. If null, it uses Theme's headline5 with accentColor
final
step int
Step between elements. Only for integer datePicker Examples: if step is 100 the following elements may be 100, 200, 300... if min=0, max=6, step=3, then items will be 0, 3 and 6 if min=0, max=5, step=3, then items will be 0 and 3.
final
textMapper TextMapper?
Build the text of each item on the picker
final
textStyle TextStyle?
Style of non-selected numbers. If null, it uses Theme's bodyText2
final
value int
Currently selected value
final
zeroPad bool
Pads displayed integer values up to the length of maxValue
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _NumberPickerState
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