|
|
@@ -15,12 +15,19 @@ import 'package:flutter_map/src/interface/map_marker_interface.dart';
|
|
|
import 'package:flutter_map/src/interface/map_polyline_interface.dart';
|
|
|
import '../entity/map_padding.dart';
|
|
|
|
|
|
-class MapController
|
|
|
+abstract class MapBaseController
|
|
|
implements MapMarkerInterface, MapFunInterface, MapPolylineInterface {
|
|
|
+ void setChannel(MethodChannel channel);
|
|
|
+
|
|
|
+ void dispose();
|
|
|
+}
|
|
|
+
|
|
|
+class MapController implements MapBaseController {
|
|
|
final _pendingOperations = <Map<String, dynamic>>[];
|
|
|
MethodChannel? _channel;
|
|
|
bool _isDisposed = false;
|
|
|
|
|
|
+ @override
|
|
|
void setChannel(MethodChannel channel) {
|
|
|
if (_isDisposed) return;
|
|
|
|
|
|
@@ -37,6 +44,7 @@ class MapController
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ @override
|
|
|
void dispose() {
|
|
|
_isDisposed = true;
|
|
|
_pendingOperations.clear();
|