ProxyProvider
triggers an assertion failure when depending on a provided value of the same type it is providing
#796
Labels
Hi and thank you for this great package. Please let me know if there's any additional detail I can add to this issue!
Describe the bug
When using
ProxyProvider
(orProxyProvider0
,ProxyProvider2
, etc.) to provide a value of a given type, while also depending an an ancestor value of that same type, a widget rebuild triggers an assertion failure within the Flutter framework:To Reproduce
A full reproduction is in the collapsed section below, but the
PartialAppThemeProvider
here is the main part:PartialAppThemeProvider
attempts to "override" theAppTheme
provided by an ancestor based on that ancestor value and a widget parameter.Full reproduction code and assertion failure stack trace
Assertion failure stack trace:
Expected behavior
My expectation is that I can use
ProxyProvider
to both depend on and provide a new value for the same type.I can work around the issue by avoiding
ProxyProvider
and tracking the ancestor dependency manually by usingProvider.of<AppTheme>(context)
in a stateful widget:The text was updated successfully, but these errors were encountered: