reportExceptionEvent static method

Future<void> reportExceptionEvent(
  1. dynamic exception,
  2. StackTrace? stack
)

This method is used for sending any report as Bug as key value pair

Implementation

static Future<void> reportExceptionEvent(
  dynamic exception,
  StackTrace? stack,
) async {
  final StackTrace stackTrace = (stack == null || stack.toString().isEmpty)
      ? StackTrace.current
      : stack;

  final List<Map<String, String>> stackTraceElements =
      getStackTraceElements(stackTrace);

  await _channel.invokeMethod('reportExceptionEvent', {
    "exception": exception.toString(),
    "stackTraceElements": stackTraceElements,
  });
}