readValue function

Object? readValue(
  1. dynamic json,
  2. String key
)

Reads a value from a JSON object using the provided key.

This helper provides a consistent way to access values from JSON objects across different content providers.

Example:

final json = {'title': 'My Post'};
final title = readValue(json, 'title');

Returns null if:

  • The input is null
  • The key does not exist
  • The value is null

Implementation

Object? readValue(dynamic json, String key) {
  return VyuhBinding.instance.content.provider.fieldValue(key, json);
}