Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

ensureInitialized() missing before setPreferredOrientations() #22

Open
maganap opened this issue Dec 28, 2019 · 1 comment
Open

ensureInitialized() missing before setPreferredOrientations() #22

maganap opened this issue Dec 28, 2019 · 1 comment
Assignees

Comments

@maganap
Copy link

maganap commented Dec 28, 2019

@flutter 1.12.13+hotfix.5
From: https://codelabs.developers.google.com/codelabs/flutter-cupertino/#2

On the first run of this lab, an error shows up when calling setPreferredOrientations() in main() because WidgetsFlutterBinding.ensureInitialized(); needs to be called first.

That line of code is missing from the codelab. Adding it solves the issue.

Screenshot 2019-12-28 at 20 05 26

@stevenyix
Copy link

this fixed the issue for me, too.

the codelab code sample here should be updated, too:
https://codelabs.developers.google.com/codelabs/flutter-cupertino/#2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants