-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from sebastianbuechler/feature/enable-mouse-s…
…croll enable mouse scroll
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/gestures.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
/// This class is used to override the default scroll behavior of the | ||
/// [MaterialApp] widget. | ||
/// | ||
/// The default scroll behavior of the [MaterialApp] widget is to only | ||
/// scroll when the user is using a touch device. This class overrides | ||
/// that behavior to allow scrolling when the user is using a mouse | ||
/// device. | ||
/// | ||
/// This class is used in the [MaterialApp.scrollBehavior] property. | ||
/// | ||
/// See: https://docs.flutter.dev/release/breaking-changes/default-scroll-behavior-drag | ||
class WebScrollBehavior extends MaterialScrollBehavior { | ||
@override | ||
Set<PointerDeviceKind> get dragDevices => { | ||
PointerDeviceKind.touch, | ||
PointerDeviceKind.mouse, | ||
PointerDeviceKind.invertedStylus, | ||
PointerDeviceKind.stylus, | ||
PointerDeviceKind.trackpad, | ||
PointerDeviceKind.unknown, | ||
}; | ||
} |