minnu
Committed by GitHub

VelocityTracker() has a fix with positional arguments

@@ -300,7 +300,17 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> @@ -300,7 +300,17 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
300 300
301 // Otherwise the calculate the velocity with a VelocityTracker 301 // Otherwise the calculate the velocity with a VelocityTracker
302 if (_velocityTracker == null) { 302 if (_velocityTracker == null) {
303 - _velocityTracker = VelocityTracker(); 303 + // Checking the device type as per the OS installed in it
  304 + // SmartPhone Devices
  305 + if (Platform.isAndroid || Platform.isIOS) {
  306 + _velocityTracker = VelocityTracker(PointerDeviceKind.touch);
  307 + }
  308 + // PCs or desktops or Laptops devices has mouse pointers
  309 + else if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
  310 + _velocityTracker = VelocityTracker(PointerDeviceKind.mouse);
  311 + } else {
  312 + _velocityTracker = VelocityTracker(PointerDeviceKind.unknown);
  313 + }
304 _startTime = DateTime.now(); 314 _startTime = DateTime.now();
305 } 315 }
306 DragUpdateDetails dragDetails; 316 DragUpdateDetails dragDetails;