watch method

  1. @override
Stream<InputLanguage?> watch({
  1. required Duration pollInterval,
})
override

Streams the keyboard language, starting with the current value where the platform can determine it. pollInterval is used by platforms that have no change notification.

Implementation

@override
Stream<InputLanguage?> watch({required Duration pollInterval}) {
  return eventChannel
      .receiveBroadcastStream(<String, Object>{
        'pollIntervalMs': pollInterval.inMilliseconds,
      })
      .map((event) => event is Map ? InputLanguage.fromMap(event) : null);
}