if (MediaQuery.of(context).orientation == Orientation.portrait){ // is portrait }else{ // is landscape }