From 806cb2071486cac6083411f16daaef9b279a50cf Mon Sep 17 00:00:00 2001 From: Andrea Valenzano Date: Fri, 12 Feb 2021 17:52:19 +0100 Subject: [PATCH] add missing clearFills() --- lib/src/controller.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/src/controller.dart b/lib/src/controller.dart index 72c1c0bd9..8a0a55a22 100644 --- a/lib/src/controller.dart +++ b/lib/src/controller.dart @@ -648,6 +648,21 @@ class MapboxMapController extends ChangeNotifier { notifyListeners(); } + /// Removes all [fill] from the map. + /// + /// Change listeners are notified once all fills have been removed on the + /// platform side. + /// + /// The returned [Future] completes once listeners have been notified. + Future clearFills() async { + assert(_fills != null); + final List fillIds = List.from(_fills.keys); + for (String id in fillIds) { + await _removeFill(id); + } + notifyListeners(); + } + /// Removes the specified [fill] from the map. The fill must be a current /// member of the [fills] set. ///