OverlayConfiguration<T> class
abstract
Describes what overlay to show and how, independent of the specific mechanism (popover, drawer, sheet, dialog, menu, tooltip).
This replaces choosing an OverlayHandler per call site (or relying on a single app-wide adaptive default in ShadcnLayer) with an explicit, per-call configuration object. Each concrete subclass (PopoverConfiguration, DrawerConfiguration, SheetConfiguration, DialogConfiguration, MenuConfiguration, TooltipConfiguration) knows how to present itself via show, and how to adapt itself for the current platform via adaptiveConversion.
Use showOverlay to present a configuration.
Example:
showOverlay(
context,
PopoverConfiguration(
alignment: Alignment.topCenter,
builder: (context) => const Text('Popover content'),
),
);
Constructors
- OverlayConfiguration()
-
Creates an OverlayConfiguration.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
adaptiveConversion(
BuildContext context) → OverlayConfiguration< T> - Returns an equivalent configuration adapted for the current platform, e.g. a PopoverConfiguration becomes a DrawerConfiguration on mobile.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
show(
BuildContext context) → OverlayCompleter< T?> - Actually presents the overlay using this configuration's mechanism.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited