Skip to content

Commit b47b16f

Browse files
authored
Clarify Overlay.initialEntries. (flutter#6701)
Closes flutter#6141
1 parent 8a91c8b commit b47b16f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ class Overlay extends StatefulWidget {
209209
}
210210

211211
/// The entries to include in the overlay initially.
212+
///
213+
/// These entries are only used when the [OverlayState] is initialized. If you
214+
/// are providing a new [Overlay] description for an overlay that's already in
215+
/// the tree, then the new entries are ignored.
216+
///
217+
/// To add entries to an [Overlay] that is already in the tree, use
218+
/// [Overlay.of] to obtain the [OverlayState] (or assign a [GlobalKey] to the
219+
/// [Overlay] widget and obtain the [OverlayState] via
220+
/// [GlobalKey.currentState]), and then use [OverlayState.add] or
221+
/// [OverlayState.addAll].
222+
///
223+
/// To remove an entry from an [Overlay], use [OverlayEntry.remove].
212224
final List<OverlayEntry> initialEntries;
213225

214226
/// The state from the closest instance of this class that encloses the given context.

0 commit comments

Comments
 (0)