JavascriptChannel constructor Null safety

JavascriptChannel(
  1. {required String name,
  2. required JavascriptMessageHandler onMessageReceived}
)

Constructs a Javascript channel.

The parameters name and onMessageReceived must not be null.

Implementation

JavascriptChannel({
  required this.name,
  required this.onMessageReceived,
})   : assert(name != null),
      assert(onMessageReceived != null),
      assert(_validChannelNames.hasMatch(name));