Scroll Behavior
When running Widgetbook on web or desktop platforms, you might want to customize the scroll behavior to allow dragging with the mouse. This can be useful if you are building widgets that require drag interactions (e.g. DraggableScrollableSheet
).
You can customize the scroll behavior by providing a scrollBehavior
to the Widgetbook
constructors.
@override
Widget build(BuildContext context) {
return Widgetbook(
// ...
scrollBehavior: const MaterialScrollBehavior().copyWith(
dragDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
},
),
);
}