showMorphDialog function
- BuildContext context, {
- Object? from,
- required MorphContentBuilder builder,
- double width = 440,
- double height = 360,
- MorphSurfaceSpec? surface,
- ShapeBorder? shape,
- Color? surfaceColor,
- MorphMotion? motion,
- bool barrierDismissible = true,
- double? maxScrimOpacity,
- Color? scrimColor,
- Color? shadowColor,
- VoidCallback? onDismissRequested,
- String? semanticLabel,
The dialog adopts its look from the app's DialogTheme (shape, color) unless overridden explicitly.
Implementation
MorphFlight showMorphDialog(
BuildContext context, {
Object? from,
required MorphContentBuilder builder,
double width = 440,
double height = 360,
MorphSurfaceSpec? surface,
ShapeBorder? shape,
Color? surfaceColor,
MorphMotion? motion,
bool barrierDismissible = true,
double? maxScrimOpacity,
Color? scrimColor,
Color? shadowColor,
VoidCallback? onDismissRequested,
String? semanticLabel,
}) {
assert(
width > 0 && height > 0,
'Dialog dimensions must be positive; got $width x $height.',
);
final DialogThemeData theme = Theme.of(context).dialogTheme;
return showMorph(
context,
from: from,
target: MorphTargetSpec.dialog(
width: width,
height: height,
surface: surface,
shape: shape ?? theme.shape,
surfaceColor: surfaceColor ?? theme.backgroundColor,
),
builder: builder,
motion: motion,
barrierDismissible: barrierDismissible,
maxScrimOpacity: maxScrimOpacity,
scrimColor: scrimColor,
shadowColor: shadowColor,
onDismissRequested: onDismissRequested,
semanticLabel: semanticLabel,
);
}