SliverVisibility.maintain constructor

const SliverVisibility.maintain({
  1. Key? key,
  2. required Widget sliver,
  3. Widget replacementSliver = const SliverToBoxAdapter(),
  4. bool visible = true,
})

Control whether the given sliver is visible.

This is equivalent to the default SliverVisibility constructor with all "maintain" fields set to true. This constructor should be used in place of a SliverOpacity widget that only takes on values of 0.0 or 1.0, as it avoids extra compositing when fully opaque.

Implementation

const SliverVisibility.maintain({
  super.key,
  required this.sliver,
  this.replacementSliver = const SliverToBoxAdapter(),
  this.visible = true,
}) :  maintainState = true,
      maintainAnimation = true,
      maintainSize = true,
      maintainSemantics = true,
      maintainInteractivity = true;