본문 바로가기
개발/Flutter web

flutter web scroll issue

by dev_caleb 2022. 10. 26.
728x90

flutter web 버전에서는 스크롤 뷰가 드래그로 동작을 하지 않는다. 그래서 설정해줘야하는 것

MaterialApp widget (처음에 theme 세팅하는 곳)에 아래와 같이 세팅해준다~ 처음에는 불가능한 줄 알고 위젯 따로 다시 만들려고 했는데 다행!ㅎㅎ

 

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scrollBehavior: MaterialScrollBehavior().copyWith(
        dragDevices: {PointerDeviceKind.mouse, PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind.unknown},
      ),
      ...

 

https://stackoverflow.com/questions/69232764/flutter-web-cannot-scroll-with-mouse-down-drag-flutter-2-5

 

Flutter Web: Cannot scroll with mouse down (drag) (Flutter 2.5+)

[Update] I can confirm this issue happened in flutter above 2.5. Using 2.2.3 is fine. The question becomes why this feature been removed in 2.5 ? And how to enable it in flutter 2.5? [Origin Questi...

stackoverflow.com

 

728x90

'개발 > Flutter web' 카테고리의 다른 글

flutter web port 설정하기  (0) 2022.10.30
flutter web deploy 하기  (0) 2022.10.30
tooltip widget  (0) 2022.10.26
flutter web kakao login 하기  (0) 2022.10.24
flutter web firebase image error  (0) 2022.10.23