@@ -107,16 +107,25 @@ public GestureDetector(
107
107
bool haveLongPressDrag = onLongPressDragStart != null || onLongPressDragUpdate != null ||
108
108
onLongPressDragUp != null ;
109
109
bool havePan = onPanStart != null || onPanUpdate != null || onPanEnd != null ;
110
- if ( havePan ) {
110
+ bool haveScale = onScaleStart != null || onScaleUpdate != null || onScaleEnd != null ;
111
+ if ( havePan || haveScale ) {
112
+ if ( havePan && haveScale ) {
113
+ throw new UIWidgetsError (
114
+ "Incorrect GestureDetector arguments.\n " +
115
+ "Having both a pan gesture recognizer and a scale gesture recognizer is redundant; scale is a superset of pan. Just use the scale gesture recognizer."
116
+ ) ;
117
+ }
118
+
119
+ string recognizer = havePan ? "pan" : "scale" ;
111
120
if ( haveVerticalDrag && haveHorizontalDrag ) {
112
121
throw new UIWidgetsError (
113
122
"Incorrect GestureDetector arguments.\n " +
114
- "Simultaneously having a vertical drag gesture recognizer, a horizontal drag gesture recognizer, and a pan gesture recognizer " +
115
- "will result in the pan gesture recognizer being ignored, since the other two will catch all drags."
123
+ $ "Simultaneously having a vertical drag gesture recognizer, a horizontal drag gesture recognizer, and a { recognizer } gesture recognizer " +
124
+ $ "will result in the { recognizer } gesture recognizer being ignored, since the other two will catch all drags."
116
125
) ;
117
126
}
118
127
}
119
-
128
+
120
129
if ( haveLongPress && haveLongPressDrag ) {
121
130
throw new UIWidgetsError (
122
131
"Incorrect GestureDetector arguments.\n " +
0 commit comments