JsonRpcHttpClient constructor

JsonRpcHttpClient({
  1. Client? client,
  2. required dynamic endpoint,
  3. JsonCodec? jsonCodec,
  4. ErrorDecoder? errorDecoder,
  5. RpcExceptionDecoder? rpcExceptionDecoder,
  6. Map<String, String>? headers,
  7. bool? omitRequestId,
  8. bool? omitRpcVersion,
})

Implementation

JsonRpcHttpClient({
  Client? client,
  required /* String | Uri */ endpoint,
  JsonCodec? jsonCodec,
  ErrorDecoder? errorDecoder,
  RpcExceptionDecoder? rpcExceptionDecoder,
  Map<String, String>? headers,
  bool? omitRequestId,
  bool? omitRpcVersion,
}) : _client = client ?? Client(),
     _endpoint = endpoint is Uri ? endpoint : Uri.parse(endpoint.toString()),
     _errorDecoder = errorDecoder,
     _rpcExceptionDecoder = rpcExceptionDecoder ?? RpcExceptionDecoder(),
     _headers = headers,
     _jsonUtf8 = (jsonCodec ?? json).fuse(utf8),
     _omitRequestId = omitRequestId ?? false,
     _omitRpcVersion = omitRpcVersion ?? false;