copyWith method
- @useResult
- ImageFilter barrierFilter()?,
- ImageFilter backgroundFilter()?,
- Duration? entranceExitDuration,
- Curve? entranceCurve,
- Curve? exitCurve,
- Tween<
double> ? fadeTween, - Tween<
double> ? scaleTween, - BoxDecoration? decoration,
- Duration? insetAnimationDuration,
- Curve? insetAnimationCurve,
- EdgeInsetsGeometry? insetPadding,
- FDialogContentStyle horizontalStyle()?,
- FDialogContentStyle verticalStyle()?,
Returns a copy of this FDialogStyle with the given properties replaced.
Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.
barrierFilter
An optional callback that takes the current animation transition value (0.0 to 1.0) and returns an ImageFilter that is used as the barrier. Defaults to null.
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),
);
This is only supported by showFDialog.
Why isn't the barrierFilter
being applied?
Make sure you are passing the FDialogStyle to the showFDialog method instead of the FDialog.
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),
);
This requires FDialog.animation to be non-null.
entranceExitDuration
The dialog's entrance/exit animation duration. Defaults to 150ms.
This requires FDialog.animation to be non-null.
entranceCurve
The dialog's entrance animation curve. Defaults to Curves.easeOutCubic.
This requires FDialog.animation to be non-null.
exitCurve
The dialog's entrance animation curve. Defaults to Curves.easeInCubic.
This requires FDialog.animation to be non-null.
fadeTween
The tween used to animate the dialog's fade in and out. Defaults to [0, 1]
.
This requires FDialog.animation to be non-null.
scaleTween
The tween used to animate the dialog's scale in and out. Defaults to [0.95, 1]
.
This requires FDialog.animation to be non-null.
decoration
The decoration.
insetAnimationDuration
The duration of the animation to show when the system keyboard intrudes into the space that the dialog is placed in.
Defaults to 100 milliseconds.
insetAnimationCurve
The curve to use for the animation shown when the system keyboard intrudes into the space that the dialog is placed in.
Defaults to Curves.decelerate.
insetPadding
The inset padding. Defaults to EdgeInsets.symmetric(horizontal: 40, vertical: 24)
.
horizontalStyle
The horizontal dialog content's style.
verticalStyle
The vertical dialog content's style.
Implementation
@useResult
FDialogStyle copyWith({
ImageFilter Function(double)? barrierFilter,
ImageFilter Function(double)? backgroundFilter,
Duration? entranceExitDuration,
Curve? entranceCurve,
Curve? exitCurve,
Tween<double>? fadeTween,
Tween<double>? scaleTween,
BoxDecoration? decoration,
Duration? insetAnimationDuration,
Curve? insetAnimationCurve,
EdgeInsetsGeometry? insetPadding,
FDialogContentStyle Function(FDialogContentStyle)? horizontalStyle,
FDialogContentStyle Function(FDialogContentStyle)? verticalStyle,
}) => FDialogStyle(
barrierFilter: barrierFilter ?? this.barrierFilter,
backgroundFilter: backgroundFilter ?? this.backgroundFilter,
entranceExitDuration: entranceExitDuration ?? this.entranceExitDuration,
entranceCurve: entranceCurve ?? this.entranceCurve,
exitCurve: exitCurve ?? this.exitCurve,
fadeTween: fadeTween ?? this.fadeTween,
scaleTween: scaleTween ?? this.scaleTween,
decoration: decoration ?? this.decoration,
insetAnimationDuration: insetAnimationDuration ?? this.insetAnimationDuration,
insetAnimationCurve: insetAnimationCurve ?? this.insetAnimationCurve,
insetPadding: insetPadding ?? this.insetPadding,
horizontalStyle: horizontalStyle != null ? horizontalStyle(this.horizontalStyle) : this.horizontalStyle,
verticalStyle: verticalStyle != null ? verticalStyle(this.verticalStyle) : this.verticalStyle,
);