A package that provides a widget that allows a single child to scroll in two dimensions, built on the two-dimensional foundation of the Flutter framework.
This package provides support for a SingleChildTwoDimensionalScrollView widget that scrolls in both the vertical and horizontal axes.
SingleChildTwoDimensionalScrollView
is insipired by SingleChildScrollView API and based on TwoDimensionalScrollView.
- Scroll diagonally, or lock axes with the
diagonalDragBehavior
type.
Run this command with Flutter:
$ flutter pub add single_child_two_dimensional_scroll_view
Now in your Dart code, you can use:
import 'package:single_child_two_dimensional_scroll_view/single_child_two_dimensional_scroll_view.dart';
The code in example/
shows a SingleChildTwoDimensionalScrollView
that allows a 2000 x 2000 pixel child scroll in two dimensions.
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".