copyWith method

  1. @useResult
FModalSheetStyle copyWith({
  1. ImageFilter barrierFilter(
    1. double
    )? = imageFilterFunctionSentinel,
  2. FModalSheetMotionDelta? motion,
  3. double? flingVelocity,
  4. double? closeProgressThreshold,
})

Returns a copy of this FModalSheetStyle 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
FModalSheetStyle copyWith({
  ImageFilter Function(double)? barrierFilter = imageFilterFunctionSentinel,
  FModalSheetMotionDelta? motion,
  double? flingVelocity,
  double? closeProgressThreshold,
}) => .new(
  barrierFilter: barrierFilter == imageFilterFunctionSentinel ? this.barrierFilter : barrierFilter,
  motion: motion?.call(this.motion) ?? this.motion,
  flingVelocity: flingVelocity ?? this.flingVelocity,
  closeProgressThreshold: closeProgressThreshold ?? this.closeProgressThreshold,
);