Skip to content

Unable to initialise value in Marker's onTap function if using #72

@PriyanshuNatani

Description

@PriyanshuNatani

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions