Skip to content

Commit c4a81e9

Browse files
authored
Remove unused replacement from Visibility.maintain (#123039)
Remove unused replacement from Visibility.maintain
1 parent 23dbc93 commit c4a81e9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/flutter/lib/src/widgets/visibility.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,20 @@ class Visibility extends StatelessWidget {
8181

8282
/// Control whether the given [child] is [visible].
8383
///
84-
/// The [child] and [replacement] arguments must not be null.
85-
///
8684
/// This is equivalent to the default [Visibility] constructor with all
8785
/// "maintain" fields set to true. This constructor should be used in place of
8886
/// an [Opacity] widget that only takes on values of `0.0` or `1.0`, as it
8987
/// avoids extra compositing when fully opaque.
9088
const Visibility.maintain({
9189
super.key,
9290
required this.child,
93-
this.replacement = const SizedBox.shrink(),
9491
this.visible = true,
9592
}) : maintainState = true,
9693
maintainAnimation = true,
9794
maintainSize = true,
9895
maintainSemantics = true,
99-
maintainInteractivity = true;
96+
maintainInteractivity = true,
97+
replacement = const SizedBox.shrink(); // Unused since maintainState is always true.
10098

10199
/// The widget to show or hide, as controlled by [visible].
102100
///

0 commit comments

Comments
 (0)