fromJson static method
Converts a Dart object represented as a Map to a JSON-encoded string.
The input data
is a Map representing the Dart object.
Implementation
static String fromJson(Object data,
{String? indent,
bool toStringEncodable = false,
Object? Function(dynamic)? toEncodable}) {
if (toStringEncodable) {
toEncodable ??= (c) => c.toString();
}
if (indent != null) {
return JsonEncoder.withIndent(indent, toEncodable).convert(data);
}
return jsonEncode(data, toEncodable: toEncodable);
}