createOverlayEntry function
Renders the overlay linked to the button pressed and displaying the dropdown.
The layerLink
maps this overlays positioned starting point to the origin of the button.
The heightOffset
is used to place the overlay exactly beneath the button
The width
and fullHeight
are used as a way to give a custom sizing to the overlay
The child
is the widget rendered inside the overlay
With the animationDuration
the duration of the slide up/down is given. This is experimental.
The changeController
is used to listen to closing and opening events
Implementation
OverlayEntry createOverlayEntry({
required LayerLink layerLink,
required double heightOffset,
required double width,
required double fullHeight,
required Widget child,
required Duration animationDuration,
required StreamController<MenuState> changeController,
}) {
return OverlayEntry(
builder: (context) => _OverlayEntryWrapper(
width: width,
heightOffset: heightOffset,
layerLink: layerLink,
fullHeight: fullHeight,
animationDuration: animationDuration,
changeController: changeController,
child: child,
));
}