decodeJsonObject function

Map<String, Object?> decodeJsonObject(
  1. String source
)

Decodes a JSON object stored in a text column.

Implementation

Map<String, Object?> decodeJsonObject(String source) {
  final decoded = jsonDecode(source);
  if (decoded is! Map<String, Object?>) {
    throw FormatException('Expected a JSON object column value.', source);
  }
  return decoded;
}