FModalSheetStyleDelta.delta constructor

const FModalSheetStyleDelta.delta({
  1. ImageFilter barrierFilter(
    1. BuildContext context,
    2. double animation
    )?,
  2. FModalSheetMotionDelta? motion,
  3. double? flingVelocity,
  4. double? closeProgressThreshold,
})

Creates a partial modification of a FModalSheetStyle.

Parameters

Prefer a static function over a closure literal. A closure literal is never equal to another, which causes widgets to flicker when the same theme is recreated.

Examples

// Blurred
(context, animation) => ImageFilter.blur(sigmaX: animation * 5, sigmaY: animation * 5);

// Solid color
(context, animation) => ColorFilter.mode(Colors.white.withValues(alpha: animation), BlendMode.srcOver);

// Tinted
(context, animation) => ColorFilter.mode(
  context.theme.colors.barrier.withValues(alpha: animation * 0.5),
  BlendMode.srcOver,
);

// Blurred & tinted
(context, 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

const factory FModalSheetStyleDelta.delta({
  ImageFilter Function(BuildContext, double)? barrierFilter,
  FModalSheetMotionDelta? motion,
  double? flingVelocity,
  double? closeProgressThreshold,
}) = _FModalSheetStyleDelta;