PrismAdaptiveDialog class
Shows adaptive dialogs: a modal bottom sheet on phones, a centered dialog on tablets and desktops — from a single call.
await PrismAdaptiveDialog.show<bool>(
context,
title: 'Delete item?',
builder: (context) => const Text('This cannot be undone.'),
actions: [
AdaptiveDialogAction.cancel(context),
AdaptiveDialogAction.destructive(
label: 'Delete',
onPressed: () => Navigator.pop(context, true),
),
],
);
Pure Flutter — no platform channels — so it works on Android, iOS, macOS, Windows, Linux, and web.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
show<
T> (BuildContext context, {required WidgetBuilder builder, String? title, List< Widget> actions = const [], PresentationStyle presentation = PresentationStyle.adaptive, bool barrierDismissible = true, Color? barrierColor, bool useSafeArea = true, RouteSettings? routeSettings, ShapeBorder? shape, double? maxWidth, }) → Future<T?> - Shows an adaptive dialog and resolves with the value the content popped with, or null if it was dismissed.