I believe what you want to use instead is Remove From Parent and pass in a reference to the Widget you want to close. I’ll update this post later with an example of how I use it in a project.
Edit: this is how I use it in my project. @SylarAtomic gives a nice explanation below.