CircleController constructor
CircleController({})
Creates a CircleController
, which wraps a gmaps.Circle
object and its onTap
behavior.
Implementation
CircleController({
required gmaps.Circle circle,
bool consumeTapEvents = false,
bool consumeCenterChangedEvents = false,
bool consumeRadiusChangedEvents = false,
ui.VoidCallback? onTap,
required ui.VoidCallback? onCenterChanged,
required ui.VoidCallback? onRadiusChanged,
}) : _circle = circle,
_consumeCenterChangedEvents = consumeCenterChangedEvents,
_consumeRadiusChangedEvents = consumeRadiusChangedEvents,
_consumeTapEvents = consumeTapEvents { /// 这是个构造方法
if (onTap != null) {
circle.onClick.listen((_) {
print("gmaps circle onClick");
onTap.call();
});
circle.onCenterChanged.listen((_) {
print("gmaps circle onCenterChanged");
onCenterChanged?.call();
});
circle.onRadiusChanged.listen((_) {
print("gmaps circle onRadiusChanged");
onRadiusChanged?.call();
});
}
}