Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

[infra_ui][overlay] Implement remaining overlap behavior

Jaylen Bian2d54ae83259b
diff --git a/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart b/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart
index 9fd3da09ba..b2e61501cf 100644
--- a/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart
+++ b/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart
@@ -264,7 +264,6 @@ class FlowyOverlayState extends State<FlowyOverlay> {
),
),
];
-
return Stack(
children: children..addAll(overlays),
);
diff --git a/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/overlay_layout_delegate.dart b/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/overlay_layout_delegate.dart
index 57b13d0584..421b746f13 100644
--- a/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/overlay_layout_delegate.dart
+++ b/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/overlay_layout_delegate.dart
@@ -55,6 +55,24 @@ class OverlayLayoutDelegate extends SingleChildLayoutDelegate {
constraints.maxHeight - anchorRect.bottom,
));
break;
+ case AnchorDirection.topWithLeftAligned:
+ childConstraints = BoxConstraints.loose(Size(
+ constraints.maxWidth - anchorRect.left,
+ anchorRect.top,
+ ));
+ break;
+ case AnchorDirection.topWithCenterAligned:
+ childConstraints = BoxConstraints.loose(Size(
+ constraints.maxWidth,
+ anchorRect.top,
+ ));
+ break;
+ case AnchorDirection.topWithRightAligned:
+ childConstraints = BoxConstraints.loose(Size(
+ anchorRect.right,
+ anchorRect.top,
+ ));
+ break;
case AnchorDirection.rightWithTopAligned:
childConstraints = BoxConstraints.loose(Size(
constraints.maxWidth - anchorRect.right,