getGrandchild method

  1. @useResult
dynamic getGrandchild(
  1. String childKey,
  2. String grandChildKey
)

Returns the nested value at childKeygrandChildKey, or null if either key is missing or the child is not a map.

Implementation

@useResult
dynamic getGrandchild(String childKey, String grandChildKey) {
  final dynamic child = this[childKey];
  if (child is Map<dynamic, dynamic>) {
    return child[grandChildKey];
  }

  return null;
}