Skip to content

Remove absorbPanEventsOnScrollables option #1455

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion example/lib/pages/map_inside_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class MapInsideListViewPage extends StatelessWidget {
height: 300,
child: FlutterMap(
options: MapOptions(
absorbPanEventsOnScrollables: true,
center: LatLng(51.5, -0.09),
zoom: 5,
),
Expand Down
3 changes: 0 additions & 3 deletions lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ class MapOptions {
/// see [InteractiveFlag] for custom settings
final int interactiveFlags;

final bool absorbPanEventsOnScrollables;

final TapCallback? onTap;
final TapCallback? onSecondaryTap;
final LongPressCallback? onLongPress;
Expand Down Expand Up @@ -293,7 +291,6 @@ class MapOptions {
final bool keepAlive;

MapOptions({
this.absorbPanEventsOnScrollables = true,
this.crs = const Epsg3857(),
LatLng? center,
this.bounds,
Expand Down
46 changes: 7 additions & 39 deletions lib/src/map/flutter_map_state.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import 'dart:math' as math;

import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/core/bounds.dart';
import 'package:flutter_map/src/gestures/gestures.dart';
import 'package:flutter_map/src/map/map.dart';
import 'package:flutter_map/src/map/map_state_widget.dart';
import 'package:latlong2/latlong.dart';
import 'dart:math' as math;
import 'package:flutter_map/src/core/bounds.dart';

class FlutterMapState extends MapGestureMixin
with AutomaticKeepAliveClientMixin {
Expand Down Expand Up @@ -72,14 +73,6 @@ class FlutterMapState extends MapGestureMixin
..onTap = _positionedTapController.onTap
..onSecondaryTap = _positionedTapController.onSecondaryTap
..onSecondaryTapDown = _positionedTapController.onTapDown;
// ..onTapCancel = onTapCancel
// ..onSecondaryTapUp = onSecondaryTapUp
// ..onSecondaryTapCancel = onSecondaryTapCancel
// ..onTertiaryTapDown = onTertiaryTapDown
// ..onTertiaryTapUp = onTertiaryTapUp
// ..onTertiaryTapCancel = onTertiaryTapCancel
// ..gestureSettings = gestureSettings;
// instance.team = _team;
},
);

Expand All @@ -88,42 +81,18 @@ class FlutterMapState extends MapGestureMixin
() => LongPressGestureRecognizer(debugOwner: this),
(LongPressGestureRecognizer instance) {
instance.onLongPress = _positionedTapController.onLongPress;
// ..onLongPressDown = onLongPressDown
// ..onLongPressCancel = onLongPressCancel
// ..onLongPressStart = onLongPressStart
// ..onLongPressMoveUpdate = onLongPressMoveUpdate
// ..onLongPressUp = onLongPressUp
// ..onLongPressEnd = onLongPressEnd
// ..onSecondaryLongPressDown = onSecondaryLongPressDown
// ..onSecondaryLongPressCancel = onSecondaryLongPressCancel
// ..onSecondaryLongPress = onSecondaryLongPress
// ..onSecondaryLongPressStart = onSecondaryLongPressStart
// ..onSecondaryLongPressMoveUpdate = onSecondaryLongPressMoveUpdate
// ..onSecondaryLongPressUp = onSecondaryLongPressUp
// ..onSecondaryLongPressEnd = onSecondaryLongPressEnd
// ..onTertiaryLongPressDown = onTertiaryLongPressDown
// ..onTertiaryLongPressCancel = onTertiaryLongPressCancel
// ..onTertiaryLongPress = onTertiaryLongPress
// ..onTertiaryLongPressStart = onTertiaryLongPressStart
// ..onTertiaryLongPressMoveUpdate = onTertiaryLongPressMoveUpdate
// ..onTertiaryLongPressUp = onTertiaryLongPressUp
// ..onTertiaryLongPressEnd = onTertiaryLongPressEnd
// ..gestureSettings = gestureSettings;
// instance.team = _team;
},
);

if (options.absorbPanEventsOnScrollables &&
InteractiveFlag.hasFlag(
options.interactiveFlags, InteractiveFlag.drag)) {
if (InteractiveFlag.hasFlag(
options.interactiveFlags, InteractiveFlag.drag)) {
gestures[VerticalDragGestureRecognizer] =
GestureRecognizerFactoryWithHandlers<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer(debugOwner: this),
(VerticalDragGestureRecognizer instance) {
instance.onUpdate = (details) {
//Absorbing vertical drags
// Absorbing vertical drags
};
// ..dragStartBehavior = dragStartBehavior
instance.gestureSettings = gestureSettings;
instance.team ??= _team;
},
Expand All @@ -133,9 +102,8 @@ class FlutterMapState extends MapGestureMixin
() => HorizontalDragGestureRecognizer(debugOwner: this),
(HorizontalDragGestureRecognizer instance) {
instance.onUpdate = (details) {
//Absorbing horizontal drags
// Absorbing horizontal drags
};
// ..dragStartBehavior = dragStartBehavior
instance.gestureSettings = gestureSettings;
instance.team ??= _team;
},
Expand Down