toJson method
Convert binary data to JSON object
Implementation
Map<String, dynamic> toJson() {
try {
return jsonDecode(toString()); // Decode the string to JSON
} catch (e) {
throw FormatException('Failed to parse JSON: ${e.toString()}');
}
}