To be able to easily explain what I need, I prepared the following image.
Shortly, I have a homepage.dart page and I embedded a map1.dart page into it. when user taps on the map, it creates a small node and adds the point into "createdMarkerPoints[]" array. I want to pass any data (List createdMarkerPoints[]) from map1.dart to a component on homepage.dart file, when:
- user clicks a button at homepage.dart (triggered at homepage.dart)
- user taps on the map at map1.dart (triggered at map1.dart)
Thank you for helps.
You could move
List createdMarkerPoints
tohomepage.dart
and then give a function that adds to createdMarkerPoints tomap1.dart
. This is a callback function.This article gives some examples: https://medium.com/@dnkibere/passing-a-function-as-an-argument-flutter-e011ad2afd86