MoonDropdown class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MoonDropdown
Constructors
-
MoonDropdown({Key? key, required bool show, Alignment? followerAnchor, Alignment? targetAnchor, bool constrainWidthToChild = false, BorderRadiusGeometry? borderRadius, Color? backgroundColor, Color borderColor = Colors.transparent, Decoration? decoration, double borderWidth = 0, double? distanceToTarget, double? minHeight, double? minWidth, double? maxHeight, double? maxWidth, Duration? transitionDuration, Curve? transitionCurve, EdgeInsetsGeometry? contentPadding, EdgeInsetsGeometry? dropdownMargin, List<
BoxShadow> ? dropdownShadows, MoonDropdownAnchorPosition dropdownAnchorPosition = MoonDropdownAnchorPosition.bottom, Offset? offset, RouteObserver<PageRoute> ? routeObserver, String? groupId, String? semanticLabel, VoidCallback? onTapOutside, required Widget child, required Widget content}) -
Creates a Moon Design dropdown.
const
Properties
- backgroundColor → Color?
-
The background color of the dropdown.
final
- borderColor → Color
-
The border color of the dropdown.
final
- borderRadius → BorderRadiusGeometry?
-
The border radius of the dropdown.
final
- borderWidth → double
-
The border width of the dropdown.
final
- child → Widget
-
The widget to display as the child (target) of the dropdown.
final
- constrainWidthToChild → bool
-
Whether to constrain the dropdown to the width of its child (target).
final
- content → Widget
-
The widget to display inside the dropdown as its content.
final
- contentPadding → EdgeInsetsGeometry?
-
The padding of the dropdown content.
final
- decoration → Decoration?
-
The custom decoration of the dropdown.
final
- distanceToTarget → double?
-
The distance between the dropdown and the child (target).
final
- dropdownAnchorPosition → MoonDropdownAnchorPosition
-
Sets the dropdown anchor position on the child (target).
final
- dropdownMargin → EdgeInsetsGeometry?
-
The margin of the dropdown. Prevents the dropdown from touching the edges of the viewport.
final
-
dropdownShadows
→ List<
BoxShadow> ? -
The list of shadows applied to the dropdown.
final
- followerAnchor → Alignment?
-
Sets the dropdown anchor position on dropdown content (follower).
final
- groupId → String?
-
The unique group ID of the dropdown.
This ID is used to associate nested dropdowns and prevent them from closing when tapped inside each other.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxHeight → double?
-
An optional size constraint for the dropdown content to define its maximum height.
final
- maxWidth → double?
-
An optional size constraint for the dropdown content to define its maximum width.
final
- minHeight → double?
-
An optional size constraint for the dropdown content to define its minimum height.
final
- minWidth → double?
-
An optional size constraint for the dropdown content to define its minimum width.
final
- offset → Offset?
-
The offset of the dropdown.
final
- onTapOutside → VoidCallback?
-
The callback that is called when the user taps outside the dropdown.
final
-
routeObserver
→ RouteObserver<
PageRoute> ? -
The observer to keep track of the route changes and automatically hide
the dropdown when the widget's route is not active.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
The semantic label for the dropdown.
final
- show → bool
-
Whether to show the dropdown.
final
- targetAnchor → Alignment?
-
Sets the dropdown anchor position on the child (target).
final
- transitionCurve → Curve?
-
The curve of the dropdown transition animation (fade in or out).
final
- transitionDuration → Duration?
-
The duration of the dropdown transition animation (fade in or out).
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _MoonDropdownState -
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