json_contains 1.0.3 copy "json_contains: ^1.0.3" to clipboard
json_contains: ^1.0.3 copied to clipboard

A library for checking if a JSON object contains another JSON object.

example/json_contains_example.dart

import 'package:json_contains/json_contains.dart';

void main() {
  // Sample JSON object
  final json = {
    "name": "John",
    "age": 30,
    "address": {"street": "Main Street", "city": "New York"}
  };

  // JSON to check if it is contained
  final jsonToContain = {
    "name": "John",
    "address": {"city": "New York"}
  };

  // Call the jsonContains function
  final result = jsonContains(json: json, jsonToContain: jsonToContain);

  if (result) {
    print("The JSON object contains the specified fields and values.");
  } else {
    print("The JSON object does not contain the specified fields and values.");
  }
}
2
likes
150
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

A library for checking if a JSON object contains another JSON object.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on json_contains