Unverified Commit 50b7940b authored by Remi Rousselet's avatar Remi Rousselet Committed by GitHub

Update the documentation of GlobalKey to explain why it is expensive (#62083)

parent b2c73754
...@@ -107,9 +107,13 @@ class ObjectKey extends LocalKey { ...@@ -107,9 +107,13 @@ class ObjectKey extends LocalKey {
/// in the same animation frame in which it was removed from its old location in /// in the same animation frame in which it was removed from its old location in
/// the tree. /// the tree.
/// ///
/// Global keys are relatively expensive. If you don't need any of the features /// Reparenting an [Element] using a global key is relatively expensive, as
/// listed above, consider using a [Key], [ValueKey], [ObjectKey], or /// this operation will trigger a call to [State.deactivate] on the associated
/// [UniqueKey] instead. /// [State] and all of its descendants; then force all widgets that depends
/// on an [InheritedWidget] to rebuild.
///
/// If you don't need any of the features listed above, consider using a [Key],
/// [ValueKey], [ObjectKey], or [UniqueKey] instead.
/// ///
/// You cannot simultaneously include two widgets in the tree with the same /// You cannot simultaneously include two widgets in the tree with the same
/// global key. Attempting to do so will assert at runtime. /// global key. Attempting to do so will assert at runtime.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment