toJson method

Map<String, dynamic> toJson()

Produces a Map that can be serialized to JSON.

Implementation

Map<String, dynamic> toJson() {
  return <String, dynamic>{
    if (_preContext?.isNotEmpty ?? false) 'pre_context': _preContext,
    if (_postContext?.isNotEmpty ?? false) 'post_context': _postContext,
    if (_vars?.isNotEmpty ?? false) 'vars': _vars,
    if (_framesOmitted?.isNotEmpty ?? false) 'frames_omitted': _framesOmitted,
    if (fileName != null) 'filename': fileName,
    if (package != null) 'package': package,
    if (function != null) 'function': function,
    if (module != null) 'module': module,
    if (lineNo != null) 'lineno': lineNo,
    if (colNo != null) 'colno': colNo,
    if (absPath != null) 'abs_path': absPath,
    if (contextLine != null) 'context_line': contextLine,
    if (inApp != null) 'in_app': inApp,
    if (native != null) 'native': native,
    if (platform != null) 'platform': platform,
    if (imageAddr != null) 'image_addr': imageAddr,
    if (symbolAddr != null) 'symbol_addr': symbolAddr,
    if (instructionAddr != null) 'instruction_addr': instructionAddr,
    if (rawFunction != null) 'raw_function': rawFunction,
    if (symbol != null) 'symbol': symbol,
    if (stackStart != null) 'stack_start': stackStart,
  };
}