onConsoleMessage method

void onConsoleMessage(
  1. String type,
  2. String? message
)

Implementation

void onConsoleMessage(String type, String? message) async {
  int messageLevel = 1;
  switch (type) {
    case 'debug':
      messageLevel = 0;
      break;
    case 'error':
      messageLevel = 3;
      break;
    case 'warn':
      messageLevel = 2;
      break;
    case 'info':
    case 'log':
    default:
      messageLevel = 1;
  }
  var obj = {"messageLevel": messageLevel, "message": message};
  await _channel?.invokeMethod("onConsoleMessage", obj);
}