dyn_mouse_scroll 1.0.2 copy "dyn_mouse_scroll: ^1.0.2" to clipboard
dyn_mouse_scroll: ^1.0.2 copied to clipboard

outdated

A wrapper for scrollable widgets that enables smooth scrolling with a mouse on all platforms.

example/example.dart

import 'package:dyn_mouse_scroll/dyn_mouse_scroll.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(BasicUsageApp());
}

class BasicUsageApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          body: DynMouseScroll(
        children: List.generate(
            40,
            (index) => Container(
                height: 500,
                color:
                    (index % 2 == 0) ? Colors.redAccent : Colors.blueAccent)),
      )),
    );
  }
}

class LinkedPhysicsApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: ParentListener(
            child: Scaffold(
                body: Center(
                    child: Column(children: [
      Expanded(
          child: Row(children: const [
        MyScrollingWidget(height: 100, colors: [Colors.blue, Colors.red]),
        MyScrollingWidget(height: 200, colors: [Colors.yellow, Colors.green]),
      ])),
      Expanded(
          child: Row(children: const [
        MyScrollingWidget(height: 150, colors: [Colors.purple, Colors.orange]),
        MyScrollingWidget(height: 80, colors: [Colors.black, Colors.white])
      ]))
    ])))));
  }
}

class MyScrollingWidget extends StatelessWidget {
  final List<Color> colors;
  final double height;
  const MyScrollingWidget(
      {Key? key, required this.colors, required this.height})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Expanded(
        child: DynMouseScroll(
            hasParentListener: true,
            children: List.generate(
                50,
                (index) => Container(
                    width: MediaQuery.of(context).size.width / 2,
                    height: height,
                    color: (index % 2 == 0) ? colors[0] : colors[1]))));
  }
}
40
likes
0
points
165
downloads

Publisher

verified publishernickblaauboer.com

Weekly Downloads

A wrapper for scrollable widgets that enables smooth scrolling with a mouse on all platforms.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider, universal_io

More

Packages that depend on dyn_mouse_scroll