show method

void show(
  1. BuildContext context,
  2. Widget contentView, {
  3. EdgeInsetsGeometry? margin,
  4. Color? backgroundColor,
})

Implementation

void show(BuildContext context, Widget contentView, {EdgeInsetsGeometry? margin, Color? backgroundColor}) {
  GlobalKey<_TopFloatingWidgetState> key = GlobalKey<_TopFloatingWidgetState>();
  _remove();
  OverlayEntry overlayEntry = OverlayEntry(
    builder: (BuildContext context) => _TopFloatingWidget(
      key: key,
      contentView: contentView,
      margin: margin,
      backgroundColor: backgroundColor,
    ),
  );
  Overlay.of(context).insert(overlayEntry);
  _overlayEntry = overlayEntry;
  _key = key;
}