Skip to content
On this page

Popup 弹出层 ​

代码演示 ​

基本用法 ​

dart
PopupStatic.show(
  context,
  padding: const EdgeInsets.all(64),
  child: const Text("内容"),
);

顶部弹出 ​

dart
PopupStatic.show(
  context,
  position: PopupPosition.top,
  constraints: const BoxConstraints.tightFor(height: 100),
);

圆角弹窗 ​

dart
PopupStatic.show(
  context,
  round: true,
  padding: const EdgeInsets.all(64),
  child: const Text("内容"),
);

API ​

Props类型描述
positiontop | bottom | left | right | center弹出层位置
paddingEdgeInsets内间距
roundbool圆角风格
closeOnClickOverlaybool点击遮罩层关闭弹出层
constraintsBoxConstraints | BoxConstraints Function(BoxConstraints con)内容尺寸约束