CircleController constructor

CircleController({
  1. required Circle circle,
  2. bool consumeTapEvents = false,
  3. bool consumeCenterChangedEvents = false,
  4. bool consumeRadiusChangedEvents = false,
  5. VoidCallback? onTap,
  6. required VoidCallback? onCenterChanged,
  7. required VoidCallback? onRadiusChanged,
})

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();
    });
  }
}