Bloc modelview is called when using textfield (keyboard show/hide)
Hi, I like your Bloc provider and tried to use it but found something strange : Modelview is called when using textfield (keyboard show/hide), what I mean the modelview is
return BlocProvider<SearchTableModelView>( bloc: SearchTableModelView(), child: TestPage());
(in above case its SearchTableModelView), and strangely it's not happening if it is in the root of the app, but if we use Navigator.push for it like
class SearchPageRoute extends StatelessWidget { @override Widget build(BuildContext context) { return BlocProvider<SearchTableModelView>( bloc: SearchTableModelView(), child: TestPage()); }
The initialization of the ModelView is called everytime keyboard show/hide (in the SearchPage) but the dispose method is only called once
Is this a flutter bug ?
Edit :
- When entering the searchPage, if TextField autofocus is false, modelView init is called once (correct)
- If I click the TextField, keyboard show up, and modelView init is called again
- If I dismiss the TextField, keyboard hide, and modelView init is called again
- and so on
Thanks
Did you manage to find a solution to this @x4080 that does not include using StatefulWidget?