How can we dynamically provde dependency in Flutter?

If I am testing the whole widget tree at once instead of partially pumping widgets, how to provide dependency mock to any specific widget?

That’s where service locators and dependency injection come in. There’s plenty of literature on that. If you follow up with a more specific question after researching this topic, we can help you answer that.

1 Like