Skip to content

Need Help: Dependency Problem with GetIt in vm:entry-point Pragma #357

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

Closed
toe-lie opened this issue Apr 2, 2024 · 1 comment
Closed

Comments

@toe-lie
Copy link

toe-lie commented Apr 2, 2024

Hello,

Hope you're doing well! So, I've been using GetIt to handle dependencies in my project, and it's been smooth sailing. But now, I've run into a problem.

Here's the scoop: When I try to access a dependency within the vm:entry-point part, it throws an error, saying that SyncWorker isn't registered in GetIt. I've checked, and SyncWorker is definitely registered. Could it be something with the vm:entry-point causing this issue?

Any thoughts or tips on how to fix this would be really appreciated!

image

@toe-lie
Copy link
Author

toe-lie commented Apr 2, 2024

Just a quick update! I found out that the issue I was facing with GetIt and Workmanager stemmed from Workmanager running on a separate isolate from the main Flutter isolate. To fix it, I made sure to initialize all dependencies inside the Workmanager().executeTask() method.

Closing the question now. Have a great day!

@toe-lie toe-lie closed this as completed Apr 2, 2024
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

1 participant