flutter / flutter/flutter

[two_dimensional_scrollables] Add the ability to build a custom row layout

Open
#145,648 2 comments 5 reactions 0 assignees View on GitHub
c: new feature c: proposal f: scrolling p: two_dimensional_scrollables P3 package team-ecosystem triaged-ecosystem
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Use case

It should allow developers to create a custom "template" for the entire row that is being built, for example, in the buildRow method, I need to add a InkWell to the entire row, so it could be nice if I could write:
```dart
TableSpan(
backgroundDecoration: decoration,
cursor: SystemMouseCursors.click,
extent: rowSpanExtent,
builder: (context, layout) => Ink(
child: InkWell(
onTap: () => print("tap!"),
child: layout,
)
),
recognizerFactories: {
TapGestureRecognizer: GestureRecognizerFactoryWithHandlers(
() => TapGestureRecognizer(),
(TapGestureRecognizer t) => t.onTap = () => debugPrint('Tap row $index'),
),
},
)
```

### Proposal

The same could be done for column builders. I tried to modify it by myself, but the only code that renders something I could find is `cell.layout()` in the `table.dart` file:
```dart
final BoxConstraints cellConstraints = BoxConstraints.tightFor(
width: mergedColumnWidth ?? standardColumnWidth,
height: mergedRowHeight ?? standardRowHeight,
);
cell.layout(cellConstraints);
```

Someone can guide me where to modify it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.