copyWith method

  1. @useResult
FDialogRouteStyle copyWith({
  1. ImageFilter Function(double)? barrierFilter()?,
  2. FDialogRouteMotionDelta? motion,
})

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

See customizing widget styles.

Parameters

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
FDialogRouteStyle copyWith({
  ImageFilter Function(double)? Function()? barrierFilter,
  FDialogRouteMotionDelta? motion,
}) => .new(
  barrierFilter: barrierFilter == null ? this.barrierFilter : barrierFilter(),
  motion: motion?.call(this.motion) ?? this.motion,
);