I have faced the same issue, captureInheritedThemes property is not awailable for Flutter 3.29.0.
You can use showMenu instead of PopupMenuButton. The negative side of showMenu is position should be handled manually.