SachinGanesh / screenshot

Flutter Screenshot Library
https://pub.dev/packages/screenshot
MIT License
327 stars 137 forks source link

FlutterError (View.of() was called with a context that does not contain a View widget. #153

Open mgeilich opened 8 months ago

mgeilich commented 8 months ago

Received this when calling captureFromWidget(), why?

Exception has occurred. FlutterError (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(). The context used was: Scrollable(axisDirection: down, physics: null, restorationId: null, dirty, state: ScrollableState#828ca(lifecycle state: initialized, position: null, effective physics: null)) This usually means that the provided context is not associated with a View.)

jaredgreener commented 5 months ago

Same issue post flutter update.

adityajangle commented 4 months ago

Pass context parameter from build context must solve the issue await screenshotController .captureFromWidget(_widget, context: context,

OpenJarvisAI commented 3 months ago

It's not work

SteveOye commented 1 month ago

passing context worked here.