Dev-Owl / advanced_datatable

Advanced Datatable uses the Fultter PaginatedDataTable Widget and adds a few more functions to it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't Scroll horizontally with flutter 2.5

cardinalblues7 opened this issue · comments

When the table has many columns and the width of the table is wider than the visible area, we used a SingleChildScrollView to contain it, in flutter 2.5 we can't scroll the table horizontally, sdk 2.2 has no problem at all.

could you find a solution?

I'm very limited in time right now due to my full time job. Its strange that the scroll widget is no longer working for one direction. I hope to get time to work on the package this weekend and of course will check this. Any help /check is very welcome.

@yunuskaygun @cardinalblues7
It's a change in Flutter:
See the docs

A workaround to make it work (please note on web you need to drag with your mouse) for me was this:

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
        PointerDeviceKind.touch,
        PointerDeviceKind.mouse,
      };
}


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scrollBehavior: MyCustomScrollBehavior(),
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Advanced DataTable Demo'),
    );
  }
}

Source for code above