flutter_map inside a showDialog(): markers are not updated on tap, they do on reopen #2157
-
|
Hi there, The problem is that when a The functionality I want to achieve is to open a map for selecting a location when I click on a button in the UI. I found Here is a short piece of code which demonstrates my issue. I appreciate your help and comments on this. I am open to using a different approach to achieve selecting a location on the map. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey 👋 Try extracting all the contents of the // In showDialog
builder: (context) => DialogWidget(),
// New widget
class DialogWidget extends StatelessWidget {
// Etc.
} |
Beta Was this translation helpful? Give feedback.
Hey 👋
Try extracting all the contents of the
builderinto a custom widget. This is usually good practise anyway as it means you can change what's shown inside the dialog during debugging with hot reload rather than having to close and reopen the dialog, and it improves code clarity. If a stateless widget doesn't do the trick, try a stateful one.