CupertinoPicker class

An iOS-styled picker.

Displays its children widgets on a wheel for selection and calls back when the currently selected item changes.

Can be used with showCupertinoModalPopup to display the picker modally at the bottom of the screen.

Sizes itself to its parent. All children are sized to the same size based on itemExtent.

By default, descendent texts are shown with CupertinoTextThemeData.pickerTextStyle.

See also:

Inheritance

Constructors

CupertinoPicker({Key key, double diameterRatio: _kDefaultDiameterRatio, Color backgroundColor: _kDefaultBackground, double offAxisFraction: 0.0, bool useMagnifier: false, double magnification: 1.0, FixedExtentScrollController scrollController, double squeeze: _kSqueeze, @required double itemExtent, @required ValueChanged<int> onSelectedItemChanged, @required List<Widget> children, bool looping: false })
Creates a picker from a concrete list of children. [...]
CupertinoPicker.builder({Key key, double diameterRatio: _kDefaultDiameterRatio, Color backgroundColor: _kDefaultBackground, double offAxisFraction: 0.0, bool useMagnifier: false, double magnification: 1.0, FixedExtentScrollController scrollController, double squeeze: _kSqueeze, @required double itemExtent, @required ValueChanged<int> onSelectedItemChanged, @required IndexedWidgetBuilder itemBuilder, int childCount })
Creates a picker from an IndexedWidgetBuilder callback where the builder is dynamically invoked during layout. [...]

Properties

backgroundColor Color
Background color behind the children. [...]
final
childDelegate ListWheelChildDelegate
A delegate that lazily instantiates children.
final
diameterRatio double
Relative ratio between this picker's height and the simulated cylinder's diameter. [...]
final
itemExtent double
The uniform height of all children. [...]
final
magnification double
The zoomed-in rate of the magnifier, if it is used. [...]
final
offAxisFraction double
How much the wheel is horizontally off-center, as a fraction of its width. This property creates the visual effect of looking at a vertical wheel from its side where its vanishing points at the edge curves to one side instead of looking at the wheel head-on. [...]
final
onSelectedItemChanged ValueChanged<int>
An option callback when the currently centered item changes. [...]
final
scrollController FixedExtentScrollController
A FixedExtentScrollController to read and control the current item. [...]
final
squeeze double
The angular compactness of the children on the wheel. [...]
final
useMagnifier bool
Whether to use the magnifier for the center item of the wheel.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.debug }) String
Returns 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 ==(dynamic other) bool
The equality operator. [...]
inherited