Skip to content

Commit

Permalink
Apply setState to change layerAdded value
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Li committed Nov 17, 2021
1 parent f853c8c commit 6ef2a38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/lib/place_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PlaceSymbolBodyState extends State<PlaceSymbolBody> {
if(layerAdded) {
removeLayer(imageLayerId);
}
layerAdded = true;
setState(() => layerAdded = true);
return controller.addImageLayer(imageLayerId, imageSourceId);
}

Expand All @@ -81,12 +81,12 @@ class PlaceSymbolBodyState extends State<PlaceSymbolBody> {
if(layerAdded) {
removeLayer(imageLayerId);
}
layerAdded = true;
setState(() => layerAdded = true);
return controller.addImageLayerBelow(imageLayerId, imageSourceId, belowLayerId);
}

Future<void> removeLayer(String imageLayerId) {
layerAdded = false;
setState(() => layerAdded = false);
return controller.removeLayer(imageLayerId);
}

Expand Down

0 comments on commit 6ef2a38

Please sign in to comment.