VisualEffectSubviewContainer constructor

const VisualEffectSubviewContainer({
  1. Key? key,
  2. required Widget child,
  3. double alphaValue = 1.0,
  4. double? cornerRadius,
  5. int cornerMask = 0xf,
  6. required WindowEffect effect,
  7. MacOSBlurViewState state = MacOSBlurViewState.followsWindowActiveState,
  8. EdgeInsets padding = EdgeInsets.zero,
  9. VisualEffectSubviewContainerResizeEventRelay? resizeEventRelay,
})

Creates a VisualEffectSubviewContainer.

The alphaValue is applied to the visual effect subview. It does not affect the opacity of the child. Similarly, the padding only affects the subview, and does not affect the child either.

The cornerRadius argument specifies the radius of the visual effect view's corners. Which corners are affected is dependent on the cornerMask argument.

Usage example:

VisualEffectSubviewContainer(
  effect: WindowEffect.hudWindow,
  cornerRadius: 32.0,
  cornerMask: VisualEffectSubviewContainer.topLeftCorner +
      VisualEffectSubviewContainer.topRightCorner +
      VisualEffectSubviewContainer.bottomRightCorner,
  child: Container(width: 128.0, height: 128.0),
)

By default, a VisualEffectSubviewContainer updates its visual effect view whenever its build method runs. If manual control over its update behavior is desired, it can be supplied a VisualEffectSubviewContainerResizeEventRelay through which its update behavior can be controlled manually.

Implementation

const VisualEffectSubviewContainer({
  Key? key,
  required this.child,
  this.alphaValue = 1.0,
  this.cornerRadius,
  this.cornerMask = 0xf,
  required this.effect,
  this.state = MacOSBlurViewState.followsWindowActiveState,
  this.padding = EdgeInsets.zero,
  this.resizeEventRelay,
}) : super(key: key);