Skip to content

Commit

Permalink
fix: set onDoubleTap on the marker widget to null as default and make…
Browse files Browse the repository at this point in the history
… it optional
  • Loading branch information
Your Name committed Jul 24, 2024
1 parent 74dda7d commit 015d546
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/src/marker_cluster_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@ class _MarkerClusterLayerState extends State<MarkerClusterLayer>
};
}

VoidCallback _onMarkerDoubleTap(MarkerNode marker) {
VoidCallback? _onMarkerDoubleTap(MarkerNode marker) {
if (widget.options.onMarkerDoubleTap == null) return null;

return () {
if (_animating) return;

Expand Down
4 changes: 2 additions & 2 deletions lib/src/marker_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import 'package:flutter_map_marker_cluster/src/node/marker_node.dart';
class MarkerWidget extends StatelessWidget {
final MarkerNode marker;
final VoidCallback onTap;
final VoidCallback onDoubleTap;
final VoidCallback? onDoubleTap;
final Function(bool)? onHover;
final bool buildOnHover;
final bool markerChildBehavior;

MarkerWidget({
required this.marker,
required this.onTap,
required this.onDoubleTap,
this.onDoubleTap,
required this.markerChildBehavior,
this.onHover,
this.buildOnHover = false,
Expand Down

0 comments on commit 015d546

Please sign in to comment.