diff --git a/dev/integration_tests/release_smoke_test/lib/main.dart b/dev/integration_tests/release_smoke_test/lib/main.dart index fefb940090..7160c30b79 100644 --- a/dev/integration_tests/release_smoke_test/lib/main.dart +++ b/dev/integration_tests/release_smoke_test/lib/main.dart @@ -17,6 +17,14 @@ Future main() async { // regression test for https://github.com/flutter/flutter/issues/49601 final List computed = await compute(_utf8Encode, 'test'); print(computed); + + // regression test for https://github.com/flutter/flutter/issues/148983 + const String value = 'testValueKey'; + const ValueKey valueKey = ValueKey(value); + if (!valueKey.toString().contains(value)) { + throw Exception('ValueKey string does not contain the value'); + } + runApp( const Center( child: text, diff --git a/packages/flutter/lib/src/foundation/key.dart b/packages/flutter/lib/src/foundation/key.dart index a14dff9d57..0940e80ac2 100644 --- a/packages/flutter/lib/src/foundation/key.dart +++ b/packages/flutter/lib/src/foundation/key.dart @@ -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] with the given [String]. ///