โโโโโโโโ Exception caught by widgets library โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Tried to use context.read<dynamic>
inside either a build
method or the update
callback of a provider.
This is unsafe to do so. Instead, consider using context.watch<dynamic>
.
If you used context.read
voluntarily as a performance optimisation, the solution
is instead to use context.select
.
class HomeScreen extends StatelessWidget {
Size _size;
HomePageStore _store;
@override
Widget build(BuildContext context) {
return MobxStatefulProvider<HomePageStore>( // I got error in this line which comes from **MobxStatefulProvider**
initFunction: (store) {
_store = store;
_size = MediaQuery.of(context).size;
},
builder: (context, store) => Scaffold(
//appBar
body: SafeArea(
child: Stack(
children: <Widget>[
_buildDrawerContainer(),
MobxWidgetProvider<HomePageStore>(
builder: (context, store) => _buildHomeContainer(),
),
],
),
),
//bottomNavigationBar
),
);
}
}