2022-10-07 11:28:55 -06:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2022-08-29 20:38:28 -06:00
|
|
|
import 'package:flutter/gestures.dart';
|
2023-12-05 10:54:56 -07:00
|
|
|
import 'package:wonders/common_libs.dart';
|
2022-08-29 20:38:28 -06:00
|
|
|
|
|
|
|
class AppScrollBehavior extends ScrollBehavior {
|
|
|
|
@override
|
2022-11-08 11:14:31 -07:00
|
|
|
// Add mouse drag on desktop for easier responsive testing
|
2022-08-29 20:38:28 -06:00
|
|
|
Set<PointerDeviceKind> get dragDevices {
|
2022-11-08 11:14:31 -07:00
|
|
|
final devices = Set<PointerDeviceKind>.from(super.dragDevices);
|
2023-07-28 10:04:51 -06:00
|
|
|
devices.add(PointerDeviceKind.mouse);
|
2022-11-08 11:14:31 -07:00
|
|
|
return devices;
|
2022-08-29 20:38:28 -06:00
|
|
|
}
|
|
|
|
|
2022-11-08 11:14:31 -07:00
|
|
|
// Use bouncing physics on all platforms, better matches the design of the app
|
2022-08-29 20:38:28 -06:00
|
|
|
@override
|
|
|
|
ScrollPhysics getScrollPhysics(BuildContext context) => const BouncingScrollPhysics();
|
|
|
|
}
|