I am trying to Show popup Menu with showMenu
Here is the minimal code
onPressed: () {
final RenderBox renderBox = _showMenuKey.currentContext?.findRenderObject() as RenderBox;
final Size size = renderBox.size;
final Offset offset = renderBox.localToGlobal(Offset.zero);
showMenu(
context: context,
position: RelativeRect.fromLTRB(
offset.dx,
offset.dy + size.height,
offset.dx + size.width,
offset.dy + size.height,
),
items: List.generate(
categoryItems.length,
(index) => PopupMenuItem(
value: index,
child: Text(categoryItems[index])),
),
).then(
(value) {
if (value != null) {
debugPrint(value.toString());
}
},
);
},
When I try to show this PopupMenu with OpenedKeyboard, the item list goes behind the keyboard. like this image.
Changing Bottom Value with offset.dy + size.height+250,
didn't move the PopupMenu top of the Keyboard
position: RelativeRect.fromLTRB(
offset.dx, //Left
offset.dy + size.height, //Top
offset.dx + size.width, //Right
offset.dy + size.height, //Bottom
),
** So, how i position the PopupMenu on top of Opened Keyboard? **
I want to show Menu item anchoring from Bottom like this Image
.
I've also tried showPop using Gesture Detector but failed