How to show a widget based on If-Then conditions?