setOrientationPortrait function

void setOrientationPortrait()

Set orientation to portrait

Implementation

void setOrientationPortrait() {
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitDown,
    DeviceOrientation.portraitUp,
  ]);
}