I am trying to use OrientationBuilder in flutter, but the first if statement in my code is always true.
OrientationBuilder(
builder: (context, orientation) {
if (orientation == Orientation.portrait) {
return _portraitMode();
} else {
return _landscapeMode();
}
},
),
I am trying to display two different things depending on the screen orientation of my phone. The problem is that, the first if statement is always true.