attachTo static method
OverlayEntry
attachTo(
- BuildContext context, {
- bool rootOverlay = true,
- double bottom = _defaultPadding,
- double right = _defaultPadding,
- bool draggable = true,
Attach overlay to specified context.
Implementation
static OverlayEntry attachTo(
BuildContext context, {
bool rootOverlay = true,
double bottom = _defaultPadding,
double right = _defaultPadding,
bool draggable = true,
}) {
// create overlay entry
final entry = OverlayEntry(
builder: (context) => NetworkLoggerOverlay._(
bottom: bottom,
right: right,
draggable: draggable,
),
);
// insert on next frame
Future.delayed(Duration.zero, () {
if (!context.mounted) return;
Overlay.of(context, rootOverlay: rootOverlay).insert(entry);
});
// return
return entry;
}