I want to change color of selected marker so i made a logic so to use this logic i want to change or replace the current value of variable for example: isSelected = true;
the reasons to i am unable to add new value on tap is this type of get function. if it is a normal function we can do it.
Future Function(Cluster) get markerBuilder => (cluster)
I want to change color of selected marker so i made a logic so to use this logic i want to change or replace the current value of variable for example: isSelected = true;
static Future Function(Cluster) get markerBuilder => (cluster) async {
return Marker(
markerId: MarkerId(cluster.getId()),
position: cluster.location,
onTap: () {
isSelected = true; // This gives me error
},
icon: await getClusterBitmap(cluster.isMultiple ? 125 : 75,
text: cluster.isMultiple? cluster.count.toString() : null),
);
};
the reasons to i am unable to add new value on tap is this type of get function. if it is a normal function we can do it. Future Function(Cluster) get markerBuilder => (cluster)
so please what is problem explain me