copyWith method

  1. @useResult
FDialogStyle copyWith({
  1. ImageFilter backgroundFilter(
    1. double
    )? = imageFilterFunctionSentinel,
  2. BoxDecorationDelta? decoration,
  3. EdgeInsetsGeometry? insetPadding,
  4. FVariantsDelta<FDialogAxisVariantConstraint, FDialogAxisVariant, FDialogContentStyle, FDialogContentStyleDelta>? contentStyle,
  5. FDialogMotionDelta? motion,
})

Returns a copy of this FDialogStyle with the given properties replaced.

See customizing widget styles.

Parameters

This is typically combined with a transparent/translucent background to create a glassmorphic effect.

Examples

// Blurred
(animation) => ImageFilter.blur(sigmaX: animation * 5, sigmaY: animation * 5);

// Solid color
(animation) => ColorFilter.mode(Colors.white.withValues(alpha: animation), BlendMode.srcOver);

// Tinted
(animation) => ColorFilter.mode(Colors.white.withValues(alpha: animation * 0.5), BlendMode.srcOver);

// Blurred & tinted
(animation) => ImageFilter.compose(
  outer: ImageFilter.blur(sigmaX: animation * 5, sigmaY: animation * 5),
  inner: ColorFilter.mode(Colors.white.withValues(alpha: animation * 0.5), BlendMode.srcOver),
);

Implementation

@useResult
FDialogStyle copyWith({
  ImageFilter Function(double)? backgroundFilter = imageFilterFunctionSentinel,
  BoxDecorationDelta? decoration,
  EdgeInsetsGeometry? insetPadding,
  FVariantsDelta<FDialogAxisVariantConstraint, FDialogAxisVariant, FDialogContentStyle, FDialogContentStyleDelta>?
  contentStyle,
  FDialogMotionDelta? motion,
}) => .new(
  backgroundFilter: backgroundFilter == imageFilterFunctionSentinel ? this.backgroundFilter : backgroundFilter,
  decoration: decoration?.call(this.decoration) ?? this.decoration,
  insetPadding: insetPadding ?? this.insetPadding,
  contentStyle: contentStyle?.call(this.contentStyle) ?? this.contentStyle,
  motion: motion?.call(this.motion) ?? this.motion,
);