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 | 类型 | 描述 |
|---|---|---|
position | top | bottom | left | right | center | 弹出层位置 |
padding | EdgeInsets | 内间距 |
round | bool | 圆角风格 |
closeOnClickOverlay | bool | 点击遮罩层关闭弹出层 |
constraints | BoxConstraints | BoxConstraints Function(BoxConstraints con) | 内容尺寸约束 |