강의 에서 나온대로 Store를 만들어서 Text() 같은 위젯에다가 넣을 경우에는 작동이 잘되지만 ,
버튼이나 네이게이션바에 onpress 에 반응하여 프린트를 하거나 조건문의 조건으로 넣게 되면 다음과 같은 오류가 뜨는데 해결방법을 모르겠습니다.
`
Tried to listen to a value exposed with provider, from outside of the widget tree.
This is likely caused by an event handler (like a button's onPressed) that called
Provider.of without passing listen: false
.
To fix, write:
Provider.of<Store>(context, listen: false);
It is unsupported because may pointlessly rebuild the widget associated to the
event handler, when the widget tree doesn't care about the value.
The context used was: HomePage(dependencies: [_LocalizationsScope-[GlobalKey#e3db6], _InheritedProviderScope<Store2?>], state: _HomePageState#5c9be)
'package:provider/src/provider.dart':
Failed assertion: line 274 pos 7: 'context.owner!.debugBuilding ||
listen == false ||
debugIsInInheritedProviderUpdate'
`