events method Null safety

  1. @override
Stream<DataEvent> events(
  1. String key,
  2. String creatorKey

Setup a EventChannel to the native side for a window identified by key.

The creatorKey is used as a unique value for each instance of a window, to ensure the right engine is linking up to the right event channel. Should default to the current window's key.


Stream<DataEvent> events(String key, String creatorKey) {
  if (!_eventChannels.containsKey(key)) {
    _eventChannels[key] = EventChannel('multi_window_linux/events/$key');
    _eventStreams[key] = _eventChannels[key]!

  return _eventStreams[key]!;