📅  最后修改于: 2022-03-11 14:58:18.937000             🧑  作者: Mango
Issue is Provider.of(context) is supposed to be used inside the widget tree,
and anything that is outside of the build() method, is not in the widget tree.
But if you still want to use it, then you need to set the listen parameter to
false.
Example:
@override
void initState() {
final _searchProvider = Provider.of(context, listen: false);
super.initState();
}