Unverified Commit 0bec3dc3 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Add UniqueKey documentation regarding const constructor (#46647)

parent ac9fefdf
...@@ -39,8 +39,15 @@ export 'package:flutter/rendering.dart' show RenderObject, RenderBox, debugDumpR ...@@ -39,8 +39,15 @@ export 'package:flutter/rendering.dart' show RenderObject, RenderBox, debugDumpR
// KEYS // KEYS
/// A key that is only equal to itself. /// A key that is only equal to itself.
///
/// This cannot be created with a const constructor because that implies that
/// all instantiated keys would be the same instance and therefore not be unique.
class UniqueKey extends LocalKey { class UniqueKey extends LocalKey {
/// Creates a key that is equal only to itself. /// Creates a key that is equal only to itself.
///
/// The key cannot be created with a const constructor because that implies
/// that all instantiated keys would be the same instance and therefore not
/// be unique.
// ignore: prefer_const_constructors_in_immutables , never use const for this class // ignore: prefer_const_constructors_in_immutables , never use const for this class
UniqueKey(); UniqueKey();
......
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