screen method
强制竖屏
orientation
当前屏幕方向
Implementation
void screen(ScreenOrientation orientation) {
if (orientation == ScreenOrientation.landscape) {
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
} else if (orientation == ScreenOrientation.portrait) {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
}
}