Skip to content

setPreferredOrientations not working in iPad  #27235

@dark-chocolate

Description

@dark-chocolate

Steps to reproduce:

void main() => runApp(MyPage());

class MyPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); // doesn't seem to work in iPad
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text("AppBar")),
        body: Text("Text"),
      ),
    );
  }
}

You can still rotate your iPad. However it works fine in iPhone.


Flutter Doctor

[✓] Flutter (Channel beta, v1.0.1-pre.1, on Mac OS X 10.14 18A389, locale en-GB)
    • Flutter version 1.0.1-pre.1 at /flutter
    • Framework revision 2f60afca7a (4 weeks ago), 2018-12-29 14:11:09 +0530
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/chocolate/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 2.0.0
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5124
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1248-b01)

[✓] Connected device (1 available)
    • iPad Pro • b1910da0802b3d6e38b23a455f95878f0ca87733 • ios • iOS 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions