What is EventChannel in Flutter?

Why Interviewers Ask This

Advanced questions like this reveal whether a candidate has internalized Flutter deeply enough to make architectural decisions. Strong answers demonstrate both breadth and depth of experience.

Answer

EventChannel is used for continuous, streaming communication from native platform code to Dart — unlike MethodChannel which is a one-shot request/response. The native side uses a StreamHandler to push events (sensor readings, Bluetooth states, connectivity changes) into an event sink. On the Dart side, you listen to the channel as a Stream: EventChannel("my_channel").receiveBroadcastStream().listen((event) { ... }). EventChannel is the correct choice for any native data that updates continuously over time.

Pro Tip

Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a Flutter codebase.