diff --git a/packages/flutter/lib/src/services/platform_channel.dart b/packages/flutter/lib/src/services/platform_channel.dart index 653eee749b..a2df96c178 100644 --- a/packages/flutter/lib/src/services/platform_channel.dart +++ b/packages/flutter/lib/src/services/platform_channel.dart @@ -156,7 +156,7 @@ class MethodChannel { } throw MissingPluginException('No implementation found for method $method on channel $name'); } - return codec.decodeEnvelope(result) as T; + return codec.decodeEnvelope(result) as T?; } /// Invokes a [method] on this channel with the specified [arguments].