encodeJson static method
BuBytes
encodeJson(
- Object json, {
- String? indent,
- bool toStringEncodable = false,
- Object? toEncodable(
- dynamic
- JsonEncodeOptions? options,
Encodes a JSON-serializable json object into a list of bytes.
Implementation
static BuBytes encodeJson(
Object json, {
String? indent,
bool toStringEncodable = false,
Object? Function(dynamic)? toEncodable,
JsonEncodeOptions? options,
}) {
if (toEncodable == null && toStringEncodable) {
toEncodable = (e) => e.toString();
}
return JsonCodec.jsonEncodeBytes(
json,
indent: indent,
options: options,
toEncodable: toEncodable,
);
}