showPopup method
Implementation
void showPopup(positionKey, context) {
final RenderBox renderBox =
positionKey.currentContext!.findRenderObject() as RenderBox;
final position =
renderBox.localToGlobal(Offset.zero);
final size = renderBox.size;
showMenu(
context: context,
surfaceTintColor: Colors.transparent,
shadowColor: const Color.fromRGBO(53, 90, 236, 0.1),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
color: Colors.white,
constraints: const BoxConstraints(maxWidth: 395),
elevation: 4,
position: RelativeRect.fromLTRB(
position.dx,
position.dy + size.height,
position.dx + size.width,
position.dy + size.height * 2,
), //
items: [
PopupMenuItem(
enabled: false,
child: this,
),
],
);
}