I have the following code where I call notifyListeners. The first function works as expected but the fetch function never calls the notifyListeners.
void toggleMapType() {
this.mapType = this.mapType == MapType.normal ? MapType.satellite : MapType.normal;
notifyListeners();
}
Future<void> fetchPlacesByKeywordAndPosition(String keyword, double latitude, double longitude) async {
final result = await Webservice().fetchPlacesByKeywordAndPosition(keyword, latitude, longitude);
this.places = result.map((place) => PlaceViewModel(place)).toList();
notifyListeners();
}