Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

scroll with mouse in flutter

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  // Override behavior methods and getters like dragDevices
  @override
  Set<PointerDeviceKind> get dragDevices => { 
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
    // etc.
  };
}

// ScrollBehavior can be set for a specific widget.
final ScrollController controller = ScrollController();
ScrollConfiguration(
  behavior: MyCustomScrollBehavior(),
  child: ListView.builder(
    controller: controller,
    itemBuilder: (BuildContext context, int index) {
     return Text('Item $index');
    }
  ),
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #scroll #mouse #flutter
ADD COMMENT
Topic
Name
2+8 =