readAsJson function
Reads the entire stream as a JSON string using the given Encoding, and then converts to an object.
maxLength— maximum allowed length. If null (default), no limit. If the input exceeds it, PayloadException is thrown.
Implementation
Future<dynamic> readAsJson(Stream<List<int>> stream,
{Encoding encoding = utf8, int? maxLength}) async
=> json.decode(await readAsString(stream,
encoding: encoding, maxLength: maxLength));