Flutter refresh map after come back from second screen

1,948 views
Skip to first unread message

filippos ser

unread,
Nov 22, 2018, 6:48:48 AM11/22/18
to Flutter Dev
I have a Flutter app which in home screen I use google map. At the begin, I call Firebase to take the places which I have already input. Then the user can add a new place if double in the map this lead him to SecondScreen. The user input title, story, and photo. I have and another screen where the user can view info for existing marker where can also delete it. My problem is when user input or delete marker and come back to the home page, in the map, the places are not refreshed and I see that the Firebase is not called again. How can I solve this problem? The Firebase is called in MapsDemo class My code:

Steven McDowall

unread,
Nov 22, 2018, 7:47:09 AM11/22/18
to filippos ser, Flutter Dev
May want to look at ModelScopeDescendent and have the data in class models in a ScopedModel to reflect changes .. 

There are other ways too .. many .. there is a Redux module for Flutter that could work etc .. 

May want to take a Flutter course .. Max S in Udemy.com has a good one that sounds very similar to your app and you write the whole thing .. or just grab the end source code .. 

Good luck

Sent from my iPad

On Nov 22, 2018, at 6:48 AM, filippos ser <sere...@gmail.com> wrote:

I have a Flutter app which in home screen I use google map. At the begin, I call Firebase to take the places which I have already input. Then the user can add a new place if double in the map this lead him to SecondScreen. The user input title, story, and photo. I have and another screen where the user can view info for existing marker where can also delete it. My problem is when user input or delete marker and come back to the home page, in the map, the places are not refreshed and I see that the Firebase is not called again. How can I solve this problem? The Firebase is called in MapsDemo class My code:

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

filippos ser

unread,
Nov 22, 2018, 10:13:31 AM11/22/18
to Flutter Dev

Edimar Martins

unread,
Oct 11, 2021, 11:16:18 AM10/11/21
to Flutter Development (flutter-dev)
I re-rendered Google maps using the follow command on resuming the application and it worked for me:
mapController.setMapStyle("[]");

Ralph Bergmann

unread,
Oct 11, 2021, 11:32:14 AM10/11/21
to Flutter Development (flutter-dev), Edimar Martins
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.

To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages