为了确定屏幕的方向,我们可以使用
OrientationBuilderWidget。OrientationBuilder将确定当前Orientation并在Orientation更改时重建。
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/



