toJson method

Map<String, dynamic> toJson()

output the map representation of this instance for processing into JSON

Implementation

Map<String, dynamic> toJson() {
  var map = <String, dynamic>{};
  map = {'jsonrpc': '2.0', 'method': method};
  if (args != null) {
    map['params'] = (args is List || args is Map) ? args : [args];
  }
  if (!notify) map['id'] = id;
  return map;
}