Deprecate VelocityTracker default constructor and added VelocityTracker.withKind constructor (#66043)
We've gotten feedback that the VelocityTracker change was disruptive, though it did not break any of the flutter framework or customer tests. In order to make the change non-breaking, PointerDeviceKind parameter can be made optional. Nevertheless, this parameter should be provided so that the existing touch handlers can use more accurate gestures on mouse/stylus inputs, so we can encourage this by deprecating the default constructor and pointing users towards the VelocityTracker.withKind constructor that takes a non-optional parameter
This commit is contained in:
@@ -20,7 +20,7 @@ void main() {
|
||||
assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'.");
|
||||
final BenchmarkResultPrinter printer = BenchmarkResultPrinter();
|
||||
final List<TrackerBenchmark> benchmarks = <TrackerBenchmark>[
|
||||
TrackerBenchmark(name: 'velocity_tracker_iteration', tracker: VelocityTracker(PointerDeviceKind.touch)),
|
||||
TrackerBenchmark(name: 'velocity_tracker_iteration', tracker: VelocityTracker.withKind(PointerDeviceKind.touch)),
|
||||
TrackerBenchmark(name: 'velocity_tracker_iteration_ios_fling', tracker: IOSScrollViewFlingVelocityTracker(PointerDeviceKind.touch)),
|
||||
];
|
||||
final Stopwatch watch = Stopwatch();
|
||||
|
||||
Reference in New Issue
Block a user