flutter_device_preview
flutter_device_preview copied to clipboard
Horizontal Scroll Not Working
Steps :
- Create ListView.builder, use scrollDirection : Axis.horizontal
- Try scrolling. It's not working.
Use custom scroll behavior in your app's root material view
MaterialApp(
scrollBehavior: MyCustomScrollBehavior(),
debugShowCheckedModeBanner: false,
useInheritedMediaQuery: true,
locale: DevicePreview.locale(context),
builder: DevicePreview.appBuilder,
);
class MyCustomScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}
this works for me.