From b47b16f44ac1ced586cd9a15ecb538793d96468f Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 3 Nov 2016 14:39:12 -0700 Subject: [PATCH] Clarify Overlay.initialEntries. (#6701) Closes https://github.com/flutter/flutter/issues/6141 --- packages/flutter/lib/src/widgets/overlay.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/flutter/lib/src/widgets/overlay.dart b/packages/flutter/lib/src/widgets/overlay.dart index bb09454d34..84182a64a3 100644 --- a/packages/flutter/lib/src/widgets/overlay.dart +++ b/packages/flutter/lib/src/widgets/overlay.dart @@ -209,6 +209,18 @@ class Overlay extends StatefulWidget { } /// The entries to include in the overlay initially. + /// + /// These entries are only used when the [OverlayState] is initialized. If you + /// are providing a new [Overlay] description for an overlay that's already in + /// the tree, then the new entries are ignored. + /// + /// To add entries to an [Overlay] that is already in the tree, use + /// [Overlay.of] to obtain the [OverlayState] (or assign a [GlobalKey] to the + /// [Overlay] widget and obtain the [OverlayState] via + /// [GlobalKey.currentState]), and then use [OverlayState.add] or + /// [OverlayState.addAll]. + /// + /// To remove an entry from an [Overlay], use [OverlayEntry.remove]. final List initialEntries; /// The state from the closest instance of this class that encloses the given context.