on method

void on(
  1. String type,
  2. void callback(
    1. PaletteMessage
    )
)

Listen for a specific message type.

Implementation

void on(String type, void Function(PaletteMessage) callback) {
  _typeCallbacks.putIfAbsent(type, () => []).add(callback);
}