PrefDropdown<T> class Null safety

Dropdown selection

Inheritance

Constructors

PrefDropdown({Key? key, required List<DropdownMenuItem<T>> items, required String pref, AlignmentGeometry alignment = AlignmentDirectional.centerStart, bool autofocus = false, BorderRadius? borderRadius, bool? disabled, Color? dropdownColor, int elevation = 8, bool? enableFeedback, Color? focusColor, FocusNode? focusNode, bool fullWidth = true, Widget? icon, Color? iconDisabledColor, Color? iconEnabledColor, double iconSize = 24.0, bool isDense = false, double? itemHeight = kMinInteractiveDimension, double? menuMaxHeight, ValueChanged<T?>? onChange, TextStyle? style, Widget? subtitle, Widget? title, Widget? underline})
create a Dropdown selection
const

Properties

alignment AlignmentGeometry
Defines how the hint or the selected item is positioned within the button.
final
autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
borderRadius BorderRadius?
Defines the corner radii of the menu's rounded rectangle shape.
final
disabled bool?
disable the widget interactions
final
The background color of the dropdown.
final
elevation int
The z-coordinate at which to place the menu when open.
final
enableFeedback bool?
Whether detected gestures should provide acoustic and/or haptic feedback.
final
focusColor Color?
The color for the button's Material when it has the input focus.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
fullWidth bool
Use all the available width
final
hashCode int
The hash code for this object.
read-onlyinherited
icon Widget?
The widget to use for the drop-down button's icon.
final
iconDisabledColor Color?
The color of any Icon descendant of icon if this button is disabled,
final
iconEnabledColor Color?
The color of any Icon descendant of icon if this button is enabled,
final
iconSize double
The size to use for the drop-down button's down arrow icon button.
final
isDense bool
Reduce the button's height.
final
itemHeight double?
If null, then the menu item heights will vary according to each menu item's intrinsic height.
final
items List<DropdownMenuItem<T>>
The items to display
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
The maximum height of the menu.
final
onChange ValueChanged<T?>?
Called when the value changes
final
pref String
The preference key
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
style TextStyle?
The text style to use for text in the dropdown button and the dropdown menu that appears when you tap the button.
final
subtitle Widget?
The subtitle
final
title Widget?
The title
final
underline Widget?
The widget to use for drawing the drop-down button's underline.
final

Methods

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