You can return from here instead, as well. Also, take(1).toList() can be changed to `.first`.

    return workspace.onResourceChange.first.then((ResourceChangeEvent event) {