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

Overlay.of(context) return nullable OverlayState, should not be accessed directly #62

Closed
UKOM opened this issue Jul 20, 2023 · 4 comments · Fixed by #66
Closed

Overlay.of(context) return nullable OverlayState, should not be accessed directly #62

UKOM opened this issue Jul 20, 2023 · 4 comments · Fixed by #66
Assignees

Comments

@UKOM
Copy link

UKOM commented Jul 20, 2023

Thanks for your working, i have used super_tooltip of version 0.9.6, it really helps me. Now when i tried to use the newest version in my new project, there is compilation error.

super_tooltip package version: 2.0.4
flutter version: 3.3.10

Compilation error:
super_tooltip-2.0.4/lib/src/super_tooltip.dart:201:29: Error: Property 'context' cannot be accessed on 'OverlayState?' because it is potentially null.
super_tooltip-2.0.4/lib/src/super_tooltip.dart:351:25: Error: Method 'insertAll' cannot be called on 'OverlayState?' because it is potentially null.

@bensonarafat
Copy link
Owner

Thanks for this.. I'll look into it.

@bensonarafat bensonarafat self-assigned this Jul 22, 2023
@bensonarafat
Copy link
Owner

@UKOM
Pls can u share your code, so I will able to help on this?
Thanks

@UKOM
Copy link
Author

UKOM commented Aug 14, 2023

@UKOM Pls can u share your code, so I will able to help on this? Thanks

There is nothing special, you can just run the sample code in README.md, and before that, make sure your flutter version is 3.3.10. I have tried to replace overlay.of(context) with overlay.of(context)? in lib/src/super_tooltip.dart source file, it then just works fine.

@bensonarafat
Copy link
Owner

thanks

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

Successfully merging a pull request may close this issue.

2 participants