MhPopup class
A widget that shows a popup relative to a target widget.
The popup is declaratively shown/hidden using an OverlayPortalController. It is positioned relative to the target widget using the followerAnchor and targetAnchor properties. Based on https://lazebny.io/popups-in-flutter/
ToDo: enhance the positioning of the PopUp in case there is not enought space to show it on the default position
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MhPopup
Constructors
- MhPopup({required Widget child, required Widget follower, required OverlayPortalController controller, required double popupWidth, required double popupHeight, Offset offset = Offset.zero, Alignment followerAnchor = Alignment.topCenter, Alignment targetAnchor = Alignment.bottomCenter, Key? key})
-
const
Properties
- child → Widget
-
The target widget that will be used to position the follower widget.
final
- controller → OverlayPortalController
-
The controller that will be used to show/hide the overlay.
final
- follower → Widget
-
The widget that will be positioned relative to the target widget.
final
- followerAnchor → Alignment
-
The alignment of the follower widget relative to the target widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- offset → Offset
-
The offset of the follower widget relative to the target widget.
This is useful for fine-tuning the position of the follower widget.
final
- popupHeight → double
-
final
- popupWidth → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targetAnchor → Alignment
-
The alignment of the target widget relative to the follower widget.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MhPopup> -
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, int wrapWidth = 65}) → 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