copyWith method

  1. @useResult
FDialogStyle copyWith({
  1. ImageFilter backgroundFilter(
    1. double
    )?,
  2. BoxDecoration? decoration,
  3. EdgeInsetsGeometry? insetPadding,
  4. FDialogContentStyle horizontalStyle(
    1. FDialogContentStyle style
    )?,
  5. FDialogContentStyle verticalStyle(
    1. FDialogContentStyle style
    )?,
  6. FDialogMotion motion(
    1. FDialogMotion motion
    )?,
})

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

Consider using the CLI to generate a style.

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,
  BoxDecoration? decoration,
  EdgeInsetsGeometry? insetPadding,
  FDialogContentStyle Function(FDialogContentStyle style)? horizontalStyle,
  FDialogContentStyle Function(FDialogContentStyle style)? verticalStyle,
  FDialogMotion Function(FDialogMotion motion)? motion,
}) => FDialogStyle(
  backgroundFilter: backgroundFilter ?? this.backgroundFilter,
  decoration: decoration ?? this.decoration,
  insetPadding: insetPadding ?? this.insetPadding,
  horizontalStyle: horizontalStyle != null ? horizontalStyle(this.horizontalStyle) : this.horizontalStyle,
  verticalStyle: verticalStyle != null ? verticalStyle(this.verticalStyle) : this.verticalStyle,
  motion: motion != null ? motion(this.motion) : this.motion,
);