containsJsonKeys method

Future<bool> containsJsonKeys(
  1. List<String> keys
)

Returns whether the content is a JSON object containing all of the given root keys.

Implementation

Future<bool> containsJsonKeys(List<String> keys) async {
  Map<String, dynamic>? json = await contentAsJson();
  if (json == null) {
    return false;
  }
  return json.keys.containsAll(keys);
}