how to capture GestureDetector for onScaleUpdate and onScaleEnd
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
Hi
I'm trying to capture a pinch to zoom action by using GestureDector as per below,
I can confirm it first `onDoubleTap `but not for `onLongPress`, `onScaleUpdae `or `onScaleEnd`.
Is it something I'd doing wrong ?
any help would be much appreciated.
```
child: GestureDetector(
child: LineChart(
// showAvg ? avgData() : mainData(),
mainData(),
),
onDoubleTap: () {
print(
'61-[line_chart_sample2.dart] onDoubleTap gesture triggered'); // this fires! and i get print statemt when I doubletap
},
onLongPress: () {
print(
'61-[line_chart_sample2.dart] onLongPress gesture triggered'); // this does not fire
},
onScaleUpdate: (details) {
print(
'61-[line_chart_sample2.dart] onScaleUpdate details = $details'); // this does not fire
},
onScaleEnd: (ScaleEndDetails details) {
print(
'61-[line_chart_sample2.dart] onScaleUpdate details = $details'); // this does not fire
},
),
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GestureDetector usage around LineChart in line_chart_sample2.dart and reproduce the missing onLongPress, onScaleUpdate, and onScaleEnd callbacks. Check how this example is wired to Flutter's gesture handling, then document or verify the required behavior so the affected callbacks fire as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100