Retain the toString method for subclasses of Key in profile/release mode (#149926)
toString methods are removed in AOT builds by the optimization in https://github.com/flutter/flutter/pull/144763 This PR disables that for Key subclasses because some applications rely on the previous behavior. Fixes https://github.com/flutter/flutter/issues/148983
This commit is contained in:
@@ -21,6 +21,7 @@ import 'diagnostics.dart';
|
||||
///
|
||||
/// * [Widget.key], which discusses how widgets use keys.
|
||||
@immutable
|
||||
@pragma('flutter:keep-to-string-in-subtypes')
|
||||
abstract class Key {
|
||||
/// Construct a [ValueKey<String>] with the given [String].
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user