Skip to content

Commit

Permalink
rewritten using ternary operators 😜.
Browse files Browse the repository at this point in the history
  • Loading branch information
yahu1031 authored Sep 12, 2020
1 parent b8f2a7e commit b27b17f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/src/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,16 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
// Otherwise the calculate the velocity with a VelocityTracker
if (_velocityTracker == null) {
// Checking the device type as per the OS installed in it
// SmartPhone Devices
if (Platform.isAndroid || Platform.isIOS) {
_velocityTracker = VelocityTracker(PointerDeviceKind.touch);
}
// PCs or desktops or Laptops devices has mouse pointers
else if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
_velocityTracker = VelocityTracker(PointerDeviceKind.mouse);
} else {
_velocityTracker = VelocityTracker(PointerDeviceKind.unknown);
}
_velocityTracker = VelocityTracker(
// SmartPhone Devices
(Platform.isAndroid || Platform.isIOS)
? PointerDeviceKind.touch
: // PCs or desktops or Laptops devices has mouse pointers
(Platform.isLinux || Platform.isWindows || Platform.isMacOS)
? VelocityTracker(PointerDeviceKind.mouse)
: // Some unknown devices
VelocityTracker(PointerDeviceKind.unknown),
);
_startTime = DateTime.now();
}
DragUpdateDetails dragDetails;
Expand Down

0 comments on commit b27b17f

Please sign in to comment.