Skip to content

Commit

Permalink
Bugfix: Cell painter and cell bar were not taking up the entire width…
Browse files Browse the repository at this point in the history
… in fit mode.
  • Loading branch information
caduandrade committed Jan 22, 2025
1 parent 6e799b7 commit 5719cd7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 4.0.1

* Bugfix
* Cell painter and cell bar were not taking up the entire width in fit mode.

## 4.0.0

* Significant performance improvements
Expand Down
7 changes: 5 additions & 2 deletions lib/src/internal/cell_widget.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:davi/davi.dart';
import 'package:davi/src/cell_semantics_builder.dart';
import 'package:davi/src/internal/column_metrics.dart';
import 'package:davi/src/internal/hover_notifier.dart';
import 'package:davi/src/internal/painter_cache.dart';
import 'package:davi/src/internal/text_cell_painter.dart';
Expand All @@ -17,6 +18,7 @@ class CellWidget<DATA> extends StatefulWidget {
required this.rowSpan,
required this.columnSpan,
required this.column,
required this.columnMetrics,
required this.daviContext,
required this.painterCache})
: cellListenable = column.cellListenable != null
Expand All @@ -30,6 +32,7 @@ class CellWidget<DATA> extends StatefulWidget {
final int rowSpan;
final int columnSpan;
final DaviColumn<DATA> column;
final ColumnMetrics columnMetrics;
final DaviContext daviContext;
final PainterCache<DATA> painterCache;
final Listenable? cellListenable;
Expand Down Expand Up @@ -141,7 +144,7 @@ class CellWidgetState<DATA> extends State<CellWidget<DATA>> {
}
} else if (widget.column.cellPainter != null) {
child = CustomPaint(
size: Size(widget.column.width, theme.cell.contentHeight),
size: Size(widget.columnMetrics.width, theme.cell.contentHeight),
painter: _CustomPainter<DATA>(
data: widget.data, cellPainting: widget.column.cellPainter!));
} else if (widget.column.cellBarValue != null) {
Expand All @@ -150,7 +153,7 @@ class CellWidgetState<DATA> extends State<CellWidget<DATA>> {
double? barValue = widget.column.cellBarValue!(params);
if (barValue != null) {
child = CustomPaint(
size: Size(widget.column.width, theme.cell.contentHeight),
size: Size(widget.columnMetrics.width, theme.cell.contentHeight),
painter: _BarPainter(
value: barValue,
text: widget.column.cellBarValueStringify != null
Expand Down
2 changes: 2 additions & 0 deletions lib/src/internal/cell_widget_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class DaviCellWidgetBuilderState<DATA>
rowSpan: cellMapping.rowSpan,
columnSpan: cellMapping.columnSpan,
column: column,
columnMetrics: widget
.layoutSettings.columnsMetrics[cellMapping.columnIndex],
daviContext: widget.daviContext,
painterCache: widget.painterCache));
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: davi
description: A full customized dataview that builds the cells on demand. Focused on Web/Desktop Applications. Bidirectional scroll bars. (DataTable, Data Table, Data View)
version: 4.0.0
version: 4.0.1
repository: https://github.com/caduandrade/davi_flutter

screenshots:
Expand Down

0 comments on commit 5719cd7

Please sign in to comment.