가로모드방지

    [플러터] 가로 모드 회전 막기

    [플러터] 가로 모드 회전 막기

    가로 모드로의 회전을 막는 방법은 매우 간단하다. 아래의 코드를 main 함수에서 실행하면 된다. SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); 추가로 ios에서는 다음과 같은 작업이 필요하다. UIInterfaceOrientationPortrait info.plist에 위 구문 추가 Runner를 X code로 오픈 후 device orientation의 portrait 옵션 활성화.