Чтобы определить ориентацию экрана, мы можем использовать виджет OrientationBuilder
.OrientationBuilder определит текущую ориентацию и восстановит ее при изменении ориентации.
new OrientationBuilder(
builder: (context, orientation) {
return new GridView.count(
// Create a grid with 2 columns in portrait mode, or 3 columns in
// landscape mode.
crossAxisCount: orientation == Orientation.portrait ? 2 : 3,
);
},
);
полный пример вы можете найти здесь: https://flutter.io/cookbook/design/orientation/