readAsJson method

Future<Object> readAsJson(
  1. {void onBlobMetadata(
    1. BlobMetadata metadata
    )}
)

Reads the blob as a JSON tree.

Optional callback onBlobMetadata, when non-null, will be invoked exactly once before the future is completed (unless an error occurs).

Implementation

Future<Object> readAsJson({
  void Function(BlobMetadata metadata) onBlobMetadata,
}) async {
  final string = await readAsString(
    onBlobMetadata: onBlobMetadata,
  );
  return const JsonDecoder().convert(string);
}