Visibility.maintain constructor

const Visibility.maintain({
  1. Key? key,
  2. required Widget child,
  3. bool visible = true,
})

Control whether the given child is visible.

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

Implementation

const Visibility.maintain({
  super.key,
  required this.child,
  this.visible = true,
}) :  maintainState = true,
      maintainAnimation = true,
      maintainSize = true,
      maintainSemantics = true,
      maintainInteractivity = true,
      replacement = const SizedBox.shrink();