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

Long widget didn't work #175

Open
OpenJarvisAI opened this issue Apr 2, 2024 · 4 comments
Open

Long widget didn't work #175

OpenJarvisAI opened this issue Apr 2, 2024 · 4 comments

Comments

@OpenJarvisAI
Copy link

View.of() was called with a context that does not contain a View widget.
No View widget ancestor could be found starting from the context that was passed to View.of().

@PhobosLegacy
Copy link

Having the same issue
@OpenJarvisAI have you found a solution?

@u-sour
Copy link

u-sour commented May 9, 2024

+1

@ritheshSalyan
Copy link
Collaborator

Could anyone provide a minimal reproducible code?

@acike
Copy link

acike commented Jul 9, 2024

There might be an issue with your widget. If it uses a ScrollController or MediaQuery, you'll need to:

-Wrap your widget with Material and MediaQuery components.
-Alternatively, pass the context object as an argument to the function that needs it.

However, if you use this approach and then perform actions like saving an image while the app is inactive and then resumed, you might encounter bugs. because when resumed the context will not works

To avoid these bugs, try to avoid using ScrollController or MediaQuery directly within the widget. If you absolutely need them, you can handle the app's resumed state using the WidgetsBindingObserver mixin

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

No branches or pull requests

5 participants