DrainChannelCallback typedef Null safety

DrainChannelCallback = Future<void> Function(ByteData? data, PlatformMessageResponseCallback callback)

Signature for ChannelBuffers.drain's callback argument.

The first argument is the data sent by the plugin.

The second argument is a closure that, when called, will send messages back to the plugin.

Implementation

// TODO(ianh): deprecate this once the framework is migrated to [ChannelCallback].
typedef DrainChannelCallback = Future<void> Function(ByteData? data, PlatformMessageResponseCallback callback);