Future<void> close([bool immediate = false]) { var currentState = key.currentState; if (currentState != null) { return currentState.close(immediate); } else { entry.remove(); } return Future.value(); }