expandFolder method

Future<void> expandFolder(
  1. DriveNode folder
)

Expands the given folder and fetches its children.

Implementation

Future<void> expandFolder(DriveNode folder) async {
  if (folder.children != null) {
    // already expanded
    return;
  }
  _getFiles(folder.id).then((children) {
    // Attach the children to the parent
    folder.children = children.map((e) => e.id).toList();
    update((p0) {
      // Add the children to the map
      p0[folder.id] = children;
      return p0;
    });
  });
}