expandedObjects property

List expandedObjects
final

expandedObjects refers to the objects that will be expanded by default. Index can be provided when the data is a List.

Examples:

data = {
  "hobbies": ["Reading books", "Playing Cricket"],
  "education": [
    {"name": "Bachelor of Engineering", "marks": 75},
    {"name": "Master of Engineering", "marks": 72},
  ],
}

For the given data

  1. To expand education pass => ["education"]
  2. To expand hobbies and education pass => ["hobbies", "education"]
  3. To expand the first element (index 0) of education list, this means we need to expand education too. In this case you need not to pass "education" separately. Just pass a list of all nested objects => [["education", 0]]
JsonEditor(
  expandedObjects: const [
    "hobbies",
    ["education", 0] // expands nested object in education
  ],
  onChanged: (_) {},
  json: jsonEncode(data),
)

Implementation

final List expandedObjects;