Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望(有点需要)Provider在小部件树的内部和外部使用相同的实例。我的理解是,ProviderContainer这样您就可以Provider在运行测试时创建多个干净的实例。我可以在同一个 Provider 实例上使用context.read(myProvider)和之类的东西吗?myProviderContainer.read(myProvider)
Provider
ProviderContainer
context.read(myProvider)
myProviderContainer.read(myProvider)
该方法是否有效,如果可以做到这一点,最佳实践方法是什么?