Skip to content

Commit 2240649

Browse files
authored
Add 'vm:keep-name' pragmas to platform channel classes (#131271)
Pragma will allow future proofing Dart snapshot utilities to work by preserving the names of important classes used in platform channel communication @Hixie
1 parent 61fd11d commit 2240649

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

packages/flutter/lib/src/services/message_codec.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ abstract class MessageCodec<T> {
3030
}
3131

3232
/// A command object representing the invocation of a named method.
33+
@pragma('vm:keep-name')
3334
@immutable
3435
class MethodCall {
3536
/// Creates a [MethodCall] representing the invocation of [method] with the

packages/flutter/lib/src/services/platform_channel.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ class BasicMessageChannel<T> {
246246
/// {@endtemplate}
247247
///
248248
/// See: <https://flutter.dev/platform-channels/>
249+
@pragma('vm:keep-name')
249250
class MethodChannel {
250251
/// Creates a [MethodChannel] with the specified [name].
251252
///

0 commit comments

Comments
 (0)