widget if else structure