文件最后提交记录最后更新时间
[two_dimensional_scrollables] Enable multi-cell/single-cell text selection in Simple Table example (#8189) This change adds a SegmentedButton to enable different variations of text selection for the example. * Multi-cell selection, enables selection across the entire table, allowing you to select across cells. * Single-cell selection, enables selection on individual cells, so the selection cannot escape the cell it started in. * Disabled, disables selection across the entire table. Text selection in a table is a common use-case that we should showcase.11 个月前
[two_dimensional_scrollables] Fix TreeView null dereference during paint (#9103) Collapsing a node when there were other nodes offscreen was causing an unexpected null dereference during painting. This PR fixes the bug and adds a test. The bug was caused by erroneous computation of the max vertical scroll extent. Previously, the code computed this considering only scroll extent in the trailing (down) direction; it may also be the case that there is a larger scroll extent in the leading (up) direction. The miscalculation resulted in subsequent error computing the first visible row as a row that is actually offscreen, and thus does not have a render box. The row render box is asserted to be non-null during painting. Fixes https://github.com/flutter/flutter/issues/149182 and https://github.com/flutter/flutter/issues/164981 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 年前
[two_dimensional_scrollables] Fix TreeView null dereference during paint (#9103) Collapsing a node when there were other nodes offscreen was causing an unexpected null dereference during painting. This PR fixes the bug and adds a test. The bug was caused by erroneous computation of the max vertical scroll extent. Previously, the code computed this considering only scroll extent in the trailing (down) direction; it may also be the case that there is a larger scroll extent in the leading (up) direction. The miscalculation resulted in subsequent error computing the first visible row as a row that is actually offscreen, and thus does not have a render box. The row render box is asserted to be non-null during painting. Fixes https://github.com/flutter/flutter/issues/149182 and https://github.com/flutter/flutter/issues/164981 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 年前
[two_dimensional_scrollables] TableView (#4536) Design doc: [flutter.dev/go/table-view](https://docs.google.com/document/d/15ecTZE1g3WeswLGFWrnEgMP6SyL6jDRdxOgPsczOcV0/edit?usp=sharing&resourcekey=0-yNd_qFhiPjz6z2TgezWc0A) Fixes https://github.com/flutter/flutter/issues/87370 Fixes https://github.com/flutter/flutter/issues/30770 This adds a new package: two_dimensional_scrollables - a package for widgets that scroll in two dimensions. The first widget in the collection here is TableView. https://github.com/flutter/packages/assets/16964204/8103001a-77dc-489f-9e75-278972f66f30 TableView is built on top of the 2D scrolling foundation that lives in the Flutter framework. Other widgets that will be included in this package in the future are TreeView and TreeTableView.2 年前
[two_dimensional_scrollables] TableView (#4536) Design doc: [flutter.dev/go/table-view](https://docs.google.com/document/d/15ecTZE1g3WeswLGFWrnEgMP6SyL6jDRdxOgPsczOcV0/edit?usp=sharing&resourcekey=0-yNd_qFhiPjz6z2TgezWc0A) Fixes https://github.com/flutter/flutter/issues/87370 Fixes https://github.com/flutter/flutter/issues/30770 This adds a new package: two_dimensional_scrollables - a package for widgets that scroll in two dimensions. The first widget in the collection here is TableView. https://github.com/flutter/packages/assets/16964204/8103001a-77dc-489f-9e75-278972f66f30 TableView is built on top of the 2D scrolling foundation that lives in the Flutter framework. Other widgets that will be included in this package in the future are TreeView and TreeTableView.2 年前
[two_dimensional_scrollables] TableView (#4536) Design doc: [flutter.dev/go/table-view](https://docs.google.com/document/d/15ecTZE1g3WeswLGFWrnEgMP6SyL6jDRdxOgPsczOcV0/edit?usp=sharing&resourcekey=0-yNd_qFhiPjz6z2TgezWc0A) Fixes https://github.com/flutter/flutter/issues/87370 Fixes https://github.com/flutter/flutter/issues/30770 This adds a new package: two_dimensional_scrollables - a package for widgets that scroll in two dimensions. The first widget in the collection here is TableView. https://github.com/flutter/packages/assets/16964204/8103001a-77dc-489f-9e75-278972f66f30 TableView is built on top of the 2D scrolling foundation that lives in the Flutter framework. Other widgets that will be included in this package in the future are TreeView and TreeTableView.2 年前
[two_dimensional_scrollables] Enable multi-cell/single-cell text selection in Simple Table example (#8189) This change adds a SegmentedButton to enable different variations of text selection for the example. * Multi-cell selection, enables selection across the entire table, allowing you to select across cells. * Single-cell selection, enables selection on individual cells, so the selection cannot escape the cell it started in. * Disabled, disables selection across the entire table. Text selection in a table is a common use-case that we should showcase.11 个月前
[two_dimensional_scrollables] TableView (#4536) Design doc: [flutter.dev/go/table-view](https://docs.google.com/document/d/15ecTZE1g3WeswLGFWrnEgMP6SyL6jDRdxOgPsczOcV0/edit?usp=sharing&resourcekey=0-yNd_qFhiPjz6z2TgezWc0A) Fixes https://github.com/flutter/flutter/issues/87370 Fixes https://github.com/flutter/flutter/issues/30770 This adds a new package: two_dimensional_scrollables - a package for widgets that scroll in two dimensions. The first widget in the collection here is TableView. https://github.com/flutter/packages/assets/16964204/8103001a-77dc-489f-9e75-278972f66f30 TableView is built on top of the 2D scrolling foundation that lives in the Flutter framework. Other widgets that will be included in this package in the future are TreeView and TreeTableView.2 年前
[two_dimensional_scrollables] TreeView (#6592) 2 年前
[two_dimensional_scrollables] Enable multi-cell/single-cell text selection in Simple Table example (#8189) This change adds a SegmentedButton to enable different variations of text selection for the example. * Multi-cell selection, enables selection across the entire table, allowing you to select across cells. * Single-cell selection, enables selection on individual cells, so the selection cannot escape the cell it started in. * Disabled, disables selection across the entire table. Text selection in a table is a common use-case that we should showcase.11 个月前
README.md

Two Dimensional Scrollables

A package that provides widgets that scroll in two dimensions, built on the two-dimensional foundation of the Flutter framework.

Features

This package provides support for TableView and TreeView widgets that scroll in both the vertical and horizontal axes.

TableView

TableView is a subclass of TwoDimensionalScrollView, building its provided children lazily in a TwoDimensionalViewport. This widget can

  • Scroll diagonally, or lock axes
  • Build infinite rows and columns
  • Apply decorations to rows and columns
  • Handle gestures & custom pointers for rows and columns
  • Pin rows and columns
  • Merge table cells

TreeView

TreeView is a subclass of TwoDimensionalScrollView, building its provided children lazily in a TwoDimensionalViewport. This widget can

  • Scroll diagonally, or lock axes
  • Apply decorations to tree rows
  • Handle gestures & custom pointers for tree rows
  • Animate TreeViewNodes in and out of view

Getting started

Depend on it

Run this command with Flutter:

$ flutter pub add two_dimensional_scrollables

Import it

Now in your Dart code, you can use:

import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';

Usage

TableView

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 TableSpanDecorations. The MergedTableExample demonstrates pinned and merged TableViewCells. Lastly, the InfiniteTableExample demonstrates an infinite TableView.

TreeView

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.

Changelog

See the Changelog for a list of new features and breaking changes.

Roadmap

See the GitHub project for a prioritized list of feature requests and known issues.

Additional information

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".