zubairehman / flutter_boilerplate_project

A boilerplate project created in flutter using MobX and Provider.
http://zubairehman.surge.sh/
MIT License
2.26k stars 908 forks source link

exception when navigate to same page #65

Closed davidchan666999 closed 4 years ago

davidchan666999 commented 4 years ago

Hello, thank you for the great work first. I am trying your boilerplate and so far so good. But i got one problem, when i call Navigator to same page, MobXCaughtException came out "setState() or markNeedsBuild() called during build.".

I just add a IconButton in home page

        onPressed: () {
          Navigator.of(context).pushReplacementNamed(Routes.home);
        },
        icon: Icon(
          Icons.power_settings_new,
        ),
      ),

when i press it, exception occurred, how can i solve this problem, thanks.

zubairehman commented 4 years ago

@davidchan666999 Could you please explain a bit more on this and why do you want to navigate to the same page?

zubairehman commented 4 years ago

Please feel free to open it again if you are still facing the issue. Thanks