A package that provides widgets that scroll in two dimensions, built on the two-dimensional foundation of the Flutter framework.
This package provides support for TableView and TreeView widgets that scroll in both the vertical and horizontal axes.
TableView
is a subclass of TwoDimensionalScrollView
, building its provided children lazily in a TwoDimensionalViewport
. This widget can
TreeView
is a subclass of TwoDimensionalScrollView
, building its provided children lazily in a TwoDimensionalViewport
. This widget can
Run this command with Flutter:
$ flutter pub add two_dimensional_scrollables
Now in your Dart code, you can use:
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';
The code in example/lib/table_view
has three TableView
samples, each showcasing different features. The TableExample
demonstrates adding and removing rows from the table, and applying TableSpanDecoration
s. The MergedTableExample
demonstrates pinned and merged TableViewCell
s. Lastly, the InfiniteTableExample
demonstrates an infinite TableView
.
The code in example/lib/tree_view
has two TreeView
samples, each showcasing different features. The TreeExample
demonstrates most of the default builders and animations. The CustomTreeExample
demonstrates a highly customized tree, utilizing TreeView.treeNodeBuilder
, TreeView.treeRowBuilder
and TreeView.onNodeToggle
.
See the Changelog for a list of new features and breaking changes.
See the GitHub project for a prioritized list of feature requests and known issues.
The package uses the two-dimensional foundation from the Flutter framework, meaning most of the core functionality of 2D scrolling is not implemented here. This also means any subclass of the foundation can create different 2D scrolling widgets and be added to the collection. If you want to contribute to this package, you can open a pull request in Flutter Packages and add the tag “p: two_dimensional_scrollables”.