copyWith method
- @useResult
- ImageFilter backgroundFilter(
- double animation
- DecorationDelta? decoration,
- TextStyleDelta? titleTextStyle,
- TextStyleDelta? bodyTextStyle,
- EdgeInsetsGeometryDelta? insetPadding,
- Future<
void> slidePressHapticFeedback()?, - FDialogMotionDelta? motion,
Returns a copy of this FDialogStyle with the given properties replaced.
See customizing widget styles.
Parameters
- FDialogStyle.backgroundFilter - An optional callback that takes the current animation transition value (0.0 to 1.0) and returns an ImageFilter that is used as the background. Defaults to null.
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),
);
- FDialogStyle.decoration - The decoration.
- FDialogStyle.titleTextStyle - The title's TextStyle.
- FDialogStyle.bodyTextStyle - The body's TextStyle.
- FDialogStyle.insetPadding - The inset padding.
- FDialogStyle.slidePressHapticFeedback - The haptic feedback for when the user slides from one action to another.
- FDialogStyle.motion - Motion-related properties.
Implementation
@useResult
FDialogStyle copyWith({
ImageFilter Function(double)? backgroundFilter = Sentinels.imageFilterFunction,
DecorationDelta? decoration,
TextStyleDelta? titleTextStyle,
TextStyleDelta? bodyTextStyle,
EdgeInsetsGeometryDelta? insetPadding,
Future<void> Function()? slidePressHapticFeedback,
FDialogMotionDelta? motion,
}) => .new(
backgroundFilter: backgroundFilter == Sentinels.imageFilterFunction ? this.backgroundFilter : backgroundFilter,
decoration: decoration?.call(this.decoration) ?? this.decoration,
titleTextStyle: titleTextStyle?.call(this.titleTextStyle) ?? this.titleTextStyle,
bodyTextStyle: bodyTextStyle?.call(this.bodyTextStyle) ?? this.bodyTextStyle,
insetPadding: insetPadding?.call(this.insetPadding) ?? this.insetPadding,
slidePressHapticFeedback: slidePressHapticFeedback ?? this.slidePressHapticFeedback,
motion: motion?.call(this.motion) ?? this.motion,
);