Locking Flutter Screen Orientation in main() Silently Kills iPad Multitasking
The bug survives testing because simulators and iPhones mask it completely; only a physical iPad reveals the missing multitasking support. A single convenience line in `main()` can generate negative App Store reviews for months before anyone connects the dots.
Locking screen orientation globally in Flutter's `main()` function works perfectly on iPhones but silently disqualifies an iPad app from multitasking. Apple requires apps to support all interface orientations to participate in Split View and Slide Over; a runtime orientation lock signals the app cannot reflow its layout, so iPadOS excludes it entirely. The failure produces no crash, no log, and no visible defect until a user tries to use the app side-by-side with another.
The fix is to move orientation locks to individual pages via `initState` and release them in `dispose` by passing an empty list to `setPreferredOrientations`. For apps that genuinely never support landscape, declare the restriction in `Info.plist` or `AndroidManifest.xml` instead of enforcing it at runtime. This keeps the system's understanding of the app's capabilities accurate.
A runtime API that behaves identically on two Apple platforms produces opposite system-level consequences, and the platform that breaks gives no feedback. This class of bug — silent capability removal — is especially dangerous in cross-platform frameworks where developers test primarily on one device family.
The recommended per-page lock-and-release pattern treats orientation as a temporary UI constraint rather than a permanent app property, which aligns with how iPadOS actually evaluates multitasking eligibility.