|
@@ -13,6 +13,7 @@ class FlowyPopover extends StatefulWidget {
|
|
final Rect anchorRect;
|
|
final Rect anchorRect;
|
|
final AnchorDirection? anchorDirection;
|
|
final AnchorDirection? anchorDirection;
|
|
final EdgeInsets padding;
|
|
final EdgeInsets padding;
|
|
|
|
+ final BoxConstraints? constraints;
|
|
|
|
|
|
FlowyPopover({
|
|
FlowyPopover({
|
|
Key? key,
|
|
Key? key,
|
|
@@ -21,6 +22,7 @@ class FlowyPopover extends StatefulWidget {
|
|
this.shape,
|
|
this.shape,
|
|
this.padding = _overlayContainerPadding,
|
|
this.padding = _overlayContainerPadding,
|
|
this.anchorDirection,
|
|
this.anchorDirection,
|
|
|
|
+ this.constraints,
|
|
}) : super(key: key);
|
|
}) : super(key: key);
|
|
|
|
|
|
static show(
|
|
static show(
|
|
@@ -31,6 +33,7 @@ class FlowyPopover extends StatefulWidget {
|
|
AnchorDirection? anchorDirection,
|
|
AnchorDirection? anchorDirection,
|
|
Size? anchorSize,
|
|
Size? anchorSize,
|
|
Offset? anchorOffset,
|
|
Offset? anchorOffset,
|
|
|
|
+ BoxConstraints? constraints,
|
|
}) {
|
|
}) {
|
|
final offset = anchorOffset ?? Offset.zero;
|
|
final offset = anchorOffset ?? Offset.zero;
|
|
Offset targetAnchorPosition = anchorPosition ?? Offset.zero;
|
|
Offset targetAnchorPosition = anchorPosition ?? Offset.zero;
|
|
@@ -59,6 +62,7 @@ class FlowyPopover extends StatefulWidget {
|
|
return FlowyPopover(
|
|
return FlowyPopover(
|
|
anchorRect: anchorRect,
|
|
anchorRect: anchorRect,
|
|
anchorDirection: anchorDirection,
|
|
anchorDirection: anchorDirection,
|
|
|
|
+ constraints: constraints,
|
|
builder: (BuildContext context) {
|
|
builder: (BuildContext context) {
|
|
return builder(context);
|
|
return builder(context);
|
|
});
|
|
});
|
|
@@ -88,7 +92,8 @@ class _FlowyPopoverState extends State<FlowyPopover> {
|
|
),
|
|
),
|
|
child: Container(
|
|
child: Container(
|
|
padding: widget.padding,
|
|
padding: widget.padding,
|
|
- constraints: BoxConstraints.loose(const Size(280, 400)),
|
|
|
|
|
|
+ constraints: widget.constraints ??
|
|
|
|
+ BoxConstraints.loose(const Size(280, 400)),
|
|
decoration: FlowyDecoration.decoration(
|
|
decoration: FlowyDecoration.decoration(
|
|
theme.surface, theme.shadowColor.withOpacity(0.15)),
|
|
theme.surface, theme.shadowColor.withOpacity(0.15)),
|
|
key: preRenderKey,
|
|
key: preRenderKey,
|