AppbarDropdown<T> class
A dropdown button that shows a menu when pressed.
Use it like this :
return Scaffold(
appBar: AppBar(
flexibleSpace: AppBarDropdown(
items: "User 1", "User 2", "User 3"
selected: "User 2",
title: ( (user) => user.toString() ),
onClick: ( (user) => print(user) ),
),
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AppbarDropdown
Constructors
-
AppbarDropdown({Key? key, required List<
T> items, T? selected, dynamic onClick(T)?, required String title(T), Color? dropdownAppBarColor, dynamic margin}) -
const
Properties
- dialogInsetPadding → EdgeInsets
-
dialogInsetPadding lets you specify padding for the dropdown itself
default is EdgeInsets.fromLTRB(0, 0, 0, 40.0)
final
- dropdownAppBarColor → Color?
-
dropdownAppBarColor can be overridden, defaults to
Theme.of(context).scaffoldBackgroundColor
final - hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
T> -
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsets
-
optional parameter margin can be set to make more space if you have
action buttons in your app bar, or if your list item titles are
especially short (or long), default is EdgeInsets.fromLTRB(60, 0, 60, 0)
final
- onClick → (dynamic Function(T)?)
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → T?
-
final
- title → String Function(T)
-
title is a function that returns the String to be displayed as the AppBar title, and as the list item labels
eg.
(T item) => item.toString()
or(e) => e.name
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _AppbarDropdownState< 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 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