showMenus method

Widget showMenus(
  1. List<PopupMenuEntry<int>> items
)

Implementation

Widget showMenus(final List<PopupMenuEntry<int>> items) => GestureDetector(
      onTapDown: (final TapDownDetails details) async {
        final Size screenSize = MediaQuery.of(navigatorKey.currentContext!).size;
        final double left = details.globalPosition.dx;
        final double top = details.globalPosition.dy;
        final double right = screenSize.width - details.globalPosition.dx;
        final double bottom = screenSize.height - details.globalPosition.dy;
        await showMenu<int>(
          context: navigatorKey.currentContext!,
          position: RelativeRect.fromLTRB(left, top, right, bottom),
          items: items,
        );
      },
      child: this,
    );