Import
import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;API Reference
The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.
Preview
const Preview({
super.key,
required this.child,
required this.previewBuilder,
this.items = const [],
this.controller,
this.onTap,
this.onOpen,
this.onSelected,
this.onOpenChanged,
this.enabled = true,
this.closeOnSelect = true,
this.dismissOnTapOutside = true,
this.openHaptic = HapticType.heavy,
this.width = 360,
this.height = 420,
this.menuWidth = 280,
this.gap = 12,
this.viewportPadding = 16,
this.backgroundColor,
this.scrimColor,
this.borderRadius,
this.backdropBlur = 12,
this.semanticLabel = 'Preview',
this.size,
this.isCompact = false,
this.motion,
});| Parameter | Type | Required | Default |
|---|---|---|---|
key | Key? | No | null |
child | Widget | Yes | — |
previewBuilder | WidgetBuilder | Yes | — |
items | List<MenuItem> | No | const [] |
controller | PreviewController? | No | null |
onTap | VoidCallback? | No | null |
onOpen | VoidCallback? | No | null |
onSelected | ValueChanged<String>? | No | null |
onOpenChanged | ValueChanged<bool>? | No | null |
enabled | bool | No | true |
closeOnSelect | bool | No | true |
dismissOnTapOutside | bool | No | true |
openHaptic | HapticType | No | HapticType.heavy |
width | double | No | 360 |
height | double | No | 420 |
menuWidth | double | No | 280 |
gap | double | No | 12 |
viewportPadding | double | No | 16 |
backgroundColor | Color? | No | null |
scrimColor | Color? | No | null |
borderRadius | double? | No | null |
backdropBlur | double | No | 12 |
semanticLabel | String | No | 'Preview' |
size | ComponentSize? | No | null |
isCompact | bool | No | false |
motion | ComponentMotion? | No | null |
Application Setup
Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.
Source
lib/src/widgets/overlays/preview/preview.dart
This reference is generated from the Preview declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

