Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

make user sheets popovers on desktop

This commit is contained in:
Henry Hiles 2026-10-15 10:25:20 -04:00
commit ce5c7b972b
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
6 changed files with 122 additions and 44 deletions

View file

@ -1,4 +1,5 @@
import "package:material_ui/material_ui.dart";
import "package:nexus/helpers/extensions/global_rect.dart";
import "package:nexus/helpers/extensions/is_desktop.dart";
extension ShowAdaptiveMenu on BuildContext {
@ -38,11 +39,7 @@ extension ShowAdaptiveMenu on BuildContext {
final overlay = Overlay.of(this).context.findRenderObject() as RenderBox;
final anchor = switch (globalPosition) {
final position? => position & Size.zero,
null => switch (findRenderObject()) {
final RenderBox box =>
box.localToGlobal(.zero, ancestor: overlay) & box.size,
_ => Rect.zero,
},
null => globalRect,
};
await showMenu(