NumberPicker class

NumberPicker is a widget designed to pick a number between #minValue and #maxValue

Inheritance

Constructors

NumberPicker.integer({Key? key, required int initialValue, required int minValue, required int maxValue, required ValueChanged<num> onChanged, bool enabled = true, TextMapper? textMapper, double itemExtent = kDefaultItemExtent, double? listViewWidth = kDefaultListViewCrossAxisSize, int step = 1, Axis scrollDirection = Axis.vertical, bool zeroPad = false, bool highlightSelectedValue = true, Decoration? decoration, bool haptics = false, TextStyle? selectedRowStyle, TextStyle? unselectedRowStyle, bool? isShowMonthName = false, bool? isJalali = false})
constructor for integer number picker

Properties

decimalPlaces int
inidcates how many decimal places to show e.g. 0=>1,2,3..., 1=>1.0, 1.1, 1.2... 2=>1.00, 1.01, 1.02...
final
decimalScrollController ScrollController?
ScrollController used for decimal list
final
decoration Decoration?
Decoration to apply to central box where the selected value is placed
final
enabled bool
build the text of each item on the picker
final
haptics bool
Whether to trigger haptic pulses or not
final
hashCode int
The hash code for this object.
no setterinherited
highlightSelectedValue bool
If currently selected value should be highlighted
final
integerItemCount int
Amount of items
final
intScrollController ScrollController
ScrollController used for integer list
final
isJalali bool?
final
isShowMonthName bool?
final
itemExtent double
height of every list element in pixels
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listViewHeight double
height of list view in pixels
final
listViewWidth double?
width of list view in pixels
final
maxValue int
max value user can pick
final
minValue int
min value user can pick
final
onChanged ValueChanged<num>
called when selected value changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
Direction of scrolling
final
selectedDecimalValue int
Currently selected decimal value
final
selectedIntValue int
Currently selected integer value
final
selectedRowStyle TextStyle?
Set selected numbers font color
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
unselectedRowStyle TextStyle?
Set unselected numbers font color
final
zeroPad bool
Pads displayed integer values up to the length of maxValue
final

Methods

animateDecimal(int decimalValue) → void
Used to animate decimal part of double value to new selected value
animateDecimalAndInteger(double valueToSelect) → void
Used to animate decimal number picker to selected value
animateInt(int valueToSelect) → void
Used to animate integer number picker to new selected value
animateIntToIndex(int index) → void
Used to animate integer number picker to new selected index
build(BuildContext context) Widget
main widget
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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
getDisplayedValue(int value) String
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

Constants

kDefaultItemExtent → const double
height of every list element for normal number picker width of every list element for horizontal number picker
kDefaultListViewCrossAxisSize → const double
width of list view for normal number picker height of list view for horizontal number picker