Showing
1 changed file
with
10 additions
and
10 deletions
| @@ -301,16 +301,16 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | @@ -301,16 +301,16 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | ||
| 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 | // Checking the device type as per the OS installed in it | 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 | + _velocityTracker = VelocityTracker( |
| 305 | + // SmartPhone Devices | ||
| 306 | + (Platform.isAndroid || Platform.isIOS) | ||
| 307 | + ? PointerDeviceKind.touch | ||
| 308 | + : // PCs or desktops or Laptops devices has mouse pointers | ||
| 309 | + (Platform.isLinux || Platform.isWindows || Platform.isMacOS) | ||
| 310 | + ? VelocityTracker(PointerDeviceKind.mouse) | ||
| 311 | + : // Some unknown devices | ||
| 312 | + VelocityTracker(PointerDeviceKind.unknown), | ||
| 313 | + ); | ||
| 314 | _startTime = DateTime.now(); | 314 | _startTime = DateTime.now(); |
| 315 | } | 315 | } |
| 316 | DragUpdateDetails dragDetails; | 316 | DragUpdateDetails dragDetails; |
-
Please register or login to post a comment