jsonExtract method

dynamic jsonExtract(
  1. String path, [
  2. dynamic fallback
])

Extracts a value from this JSON string using dot notation path

path The dot notation path (e.g., 'user.profile.name') fallback The value to return if path is not found

Returns the value at the path or fallback if not found

Example:

final json = '{"user":{"profile":{"name":"John"}}}';
final name = json.jsonExtract('user.profile.name');
print(name); // John

Implementation

dynamic jsonExtract(String path, [dynamic fallback]) {
  return QJSONUtils.extractValue(this, path, fallback);
}