Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There will be an issue in latest update in flutter SDk #4

Merged
merged 1 commit into from Oct 19, 2019

Conversation

darwinvtomy
Copy link
Contributor

I tried cloning your project ended up with some issues due to the fact that i was using dev version of the flutter SDk.
but I fixed it by adding the following line

I tried cloning your project ended up with some issues due to the fact that i was using dev version of the flutter SDk.
but I fixed it by adding the following line
@iampawan
Copy link
Owner

iampawan commented Sep 5, 2019

It might be a different problem. I am not sure whether this is how we should fix this.

@iampawan iampawan merged commit ddb709a into iampawan:master Oct 19, 2019
@xsahil03x
Copy link
Contributor

@darwinvtomy the issue you faced can have two main reasons.

  1. You must be running it on an emulator.
  2. You must be running it on a slow device.

The issue was basically that we are configuring various important classes before actually rendering any widget on the screen. The configuration time can vary from device to device.
So by adding WidgetsFlutterBinding.ensureInitialized() before runApp() ensures that the WidgetsFlutterBinding class is initialized already and can be used directly by runApp() to attach the widget to the screen right after all the configuration is done.

As the documentation says :
WidgetsFlutterBinding is the glue that binds the framework to the Flutter engine.

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

Successfully merging this pull request may close these issues.

None yet

3 participants