davi 5.0.0
davi: ^5.0.0 copied to clipboard
A full customized dataview that builds the cells on demand. Focused on Web/Desktop Applications. Bidirectional scroll bars. (DataTable, Data Table, Data View)
5.0.0 #
- New builder mode:
Davi.builderlets the rows come from an external source (aState, Bloc,ChangeNotifier, etc.), which also owns their order, instead of being held by aDaviModel. It fits apps that already use a state management solution, and cases like server-side sorting.- The rows are passed directly to
Davi.builderthroughrows. When the data changes, rebuild it with a new list, likeListView.builder; don't modify the same list in place. - The new
DaviControllerkeeps only the state of the columns (order, width and the sort indicator), never the rows. - Tapping a sortable header never reorders the rows: it updates the sort indicator and calls
onSort, and whoever owns the data applies the order and rebuilds. WithoutonSort, sorting is disabled. DaviController.applySortupdates the sort indicator without touching the data, for example to reflect a sort changed programmatically or to revert a rejected one.- The existing mode, based on
DaviModel(the defaultDaviconstructor), is now called model mode and works as before.
- The rows are passed directly to
- Column auto size, only with
ColumnWidthBehavior.scrollable: the column width is adjusted to fit its content, limited bymaxAutoSizeWidth. Only the header and the cells of the rows visible in the viewport at the moment are measured: rows outside the scroll area are not, so the cost doesn't depend on the number of rows.initialAutoSizedoes it once, as soon as there are rows to display. After that, the width no longer follows the content.- Double clicking the resize area of a column header does it again for that column.
autoSizeColumnsdoes it again for all resizable columns, for example after loading new data.
- Row height is now dynamic: each row automatically grows to fit its content, the same way the header row already does, instead of using a single fixed height for every row.
- Cell merging (
rowSpan/columnSpan) has been removed. It was one of the main blockers to making row height dynamic, made sorting and horizontal merging harder to reason about together, and added significant internal complexity for a rarely used feature. Removing it keeps the package simpler to maintain. - Changes
DaviColumn- The
rowSpanandcolumnSpanattributes have been removed. - New
initialAutoSizeandmaxAutoSizeWidthattributes.
- The
DaviModel- The
maxRowSpan,maxColumnSpan,maxSpanBehavior,rowSpanOverflowBehaviorandcollisionBehaviorattributes have been removed. - New
autoSizeColumnsmethod.
- The
CellThemeData- The
contentHeightattribute has been removed; height is now derived automatically from cell content.
- The
RowThemeData- New
estimatedHeightattribute: an initial height hint used only until a row's real content is measured.
- New
DaviColumncellOverflownow actually applies tocellValuecells (it was previously unused): leave it unset to let text wrap onto multiple lines and grow the row, or set it (e.g.TextOverflow.ellipsis) to keep it on a single line as before.
- Removed
SpanProvider,SpanParams,MaxSpanBehavior,RowSpanOverflowBehaviorandCellCollisionBehavior.
Davi- New
Davi.buildernamed constructor, with thecontroller,rowsandonSortattributes. - The
modelattribute is now nullable (it isnullin builder mode), and there's a newcontrollerattribute (nullin model mode). - New
DaviControllerclass.
- New
- Bugfix
- Columns with
cellFocusTraversalEnabled: truenow support TAB and Shift+TAB across controls built withcellWidgetand virtualized rows, revealing the destination with vertical and horizontal scrolling (including pinned columns). Disabled controls are skipped and traversal continues outside the table at its boundaries. The feature is opt-in so custom cells without focusable controls avoid its bookkeeping cost. - Cell text with no explicit
textStyle(the default) could render invisible/white instead of a visible color, since it bypassedDefaultTextStyleinheritance.
- Columns with
4.1.0 #
- The header row height is no longer fixed by the theme; it now adapts automatically to the header content's actual height.
DaviColumnhas a new optionalheaderBuilder, letting you fully customize the header content instead of the automaticText(name).- The header's text style is now inherited by any
Textin the header row, including customleading/headerBuildercontent, instead of needing to be set explicitly. - Improved scrolling performance: the table no longer recomputes cell mapping, spans, collisions and dividers on every scroll frame, only when the visible rows actually change.
- You can now scroll horizontally by clicking (or trackpad-dragging) and dragging anywhere in the table body, not just the scrollbar.
- Bugfix
- Columns were no longer resizable when
DaviModel.sortingModewas set toSortingMode.disabled.
- Columns were no longer resizable when
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
- Internal tests show Flutter frame rates during scrolling increasing from 5 FPS to over 30 FPS
- Cell merging
- Column summary (Footer)
- New cell types
- Custom rendering using Canvas
- Percentage bar
- Changes
Davi- The
lastRowWidgetattribute has been renamed totrailingWidget. - The
onLastRowWidgetattribute has been renamed toonTrailingWidget. - The
pinnedHorizontalScrollControllerattribute has been renamed toleftPinnedHorizontalScrollController. - The
modelattribute is now non-nullable. - The
tapToSortEnabledattribute has been replaced byDaviModel.sortingMode. - The
placeholderWidgetattribute has been added.
- The
DaviModel- The
alwaysSortedattribute has been replaced bysortingMode. - The
onSorthas been changed to be called before sorting.
- The
DaviColumn- The
stringValue,intValue,objectValueanddoubleValueattributes has been replaced bycellValue. - The
cellBuilderattribute has been replaced bycellWidget. - The
iconValueMapperattribute has been replaced bycellIcon. - The
fractionDigitsattribute has been removed. - The
cellStyleBuilderattribute has been removed. - The
cellTextStyleattribute has been updated from aTextStyletype to a builder of typeCellTextStyleBuilder - The default
cellClipvalue has been changed toTRUE. - The
growattribute is now applied only during the initial layout for columns whenColumnWidthBehavioris set toscrollable. - The
sortattribute has been renamed tosortDirection.- The type has been changed from
DaviSorttoDaviSortDirection.
- The type has been changed from
- The
CellThemeData- The
overflowattribute has been removed.
- The
DaviThemeData- The
topCornerBorderColorattribute has been moved toEdgeThemeData.headerColor. - The
topCornerColorattribute has been changed toEdgeThemeDataattributes:headerBottomBorderColorandheaderLeftBorderColor. - The
bottomCornerBorderColorattribute has been changed toEdgeThemeDataattribute:scrollbarLeftBorderColorandscrollbarTopBorderColor. - The
bottomCornerColorattribute has been moved toEdgeThemeData.scrollbarColor. - The
copyWithmethod has been removed.
- The
RowThemeData- The
cursorattribute has been renamed tocallbackCursor. - The
cursorOnTapGesturesOnlyattribute has been removed. - The
copyWithmethod has been removed. - The
lastDividerVisibleattribute has been removed.
- The
HeaderThemeData- The
bottomBorderHeightattribute has been renamed tobottomBorderThickness. - The
copyWithmethod has been removed.
- The
CellThemeData- The
copyWithmethod has been removed.
- The
HeaderCellThemeData- The
copyWithmethod has been removed.
- The
- Typedefs
DaviDataComparator- Has been renamed to
DaviComparator - Updated the signature to include
rowAandrowBparameters, and removed thecolumnparameter
- Has been renamed to
DaviRowCursor- Has been renamed to
RowCursorBuilder. - Its signature has been changed from
DaviRowtoCursorBuilderParams
- Has been renamed to
OnLastRowWidgetListenertoTrailingWidgetListenerOnLastVisibleRowListenertoLastVisibleRowListenerDaviCellSemanticsBuilder- Its signature has been changed from
DaviRowtoSemanticsBuilderParams
- Its signature has been changed from
CellBackgroundBuilder- Its signature has been changed from
DaviRowtoBackgroundBuilderParams
- Its signature has been changed from
- Removed classes and typedefs
DaviIntValueMapperDaviDoubleValueMapperDaviStringValueMapperDaviObjectValueMapperDaviIconValueMapperCellStyleBuilderDaviRow
- BugFixes
- Focus problem between instances (or simply another focus widget)
- Scroll is moving in opposite direction on Android.
3.5.0 #
Davi- Added onRowSecondaryTapUp to get TapUpDetail
3.4.1 #
- Upgraded
renderObject.parentobject to useRenderObjectinstead of the deprecatedAbstractNode. This ensures compatibility and resolves deprecation Flutter v3.13.0.
3.4.0 #
- BugFix
- On-screen keyboard not showing up in Windows.
- Semantics configuration individually for each cell.
- New typedef:
DaviCellSemanticsBuilder. DaviColumn- New attribute:
semanticsBuilder
- New attribute:
- New typedef:
3.3.0 #
- Adding
copyWithmethod to theme classes:DaviThemeData,HeaderCellThemeData,HeaderThemeData,RowThemeData,CellThemeDataandTableScrollbarThemeData.
3.2.0 #
Davi- The
multiSortattribute has been moved toDaviModelasmultiSortEnabled.
- The
DaviModel- New attribute:
alwaysSorted.- Defines if there will always be some sorted column.
- The
ignoreSortattribute has been renamed toignoreDataComparators. - New methods:
getColumn(dynamic id)andsortList. - Removed methods:
multiSortByColumn,sortByColumnIndexandsortByColumn.
- New attribute:
DaviColumn- The
sortattribute has been renamed todataComparator. - The
priorityandorderattributes has been replaced by the newsortattribute. - The
isSortedhas been removed.
- The
HeaderCellThemeData- The
sortOrderSizeattribute has been renamed tosortPrioritySize
- The
- The
DaviColumnSorttypedef has been renamed toDaviDataComparator - The
TableSortOrderenum has been renamed toDaviSortDirection - The
ColumnSortclass has been renamed toDaviSort- The
orderattribute has been renamed todirection. - The
columnIndex(int) has been replaced bycolumnId(dynamic).
- The
HeaderCellThemeData- Default sorting icons have been changed.
- The
sortIconColorattribute has been replaced bysortIconColors(ascending and descending). - The
ascendingIconanddescendingIconattributes has been replaced bysortIconBuilder. - New attributes:
sortPriorityColorandsortPriorityGap.
SortIconBuilders- Default sort icon builders.
3.1.1 #
- Bugfix
DaviModeland scroll controllers being disposed byDavi.
3.1.0 #
- Adding semantics on header and cells.
- Allow to ignore sorting functions. Useful for server-side sorting when loading data.
DaviModel- New callback:
onSort. - New attribute:
ignoreSort.- Ignore column sorting functions to maintain the natural order of the data. Allows the header to be sortable if the column is also sortable.
- New callback:
Davi- New attribute:
tapToSortEnabled.- Indicates whether sorting events are enabled on the header. final bool sortable;
- New attribute:
- Refactor
- The
sortableattribute of theDaviColumncan beTRUEeven without asortfunction. - Typedef
DaviColumnSort- New attribute:
DaviColumn<DATA> column
- New attribute:
- The
3.0.0 #
- Renaming classes and attributes
EasyTable<ROW>toDavi<DATA>EasyTableColumn<ROW>toDaviColumn<DATA>EasyTableThemetoDaviThemeEasyTableThemeDatatoDaviThemeDataRowData<ROW>toDaviRow<DATA>̀ROW rowtoDATA data
EasyTableModel<ROW>toDaviModel<DATA>EasyTableRowColor<ROW>(RowData<ROW> data)toDaviRowColor<DATA>(DaviRow<DATA> row)EasyTableRowCursor<DATA>(RowData<DATA> data)toDaviRowCursor<DATA>(DaviRow<DATA> row)EasyTableColumnSort<ROW>(ROW a, ROW b)toDaviColumnSort<DATA>(DATA a, DATA b)RowTapCallback<ROW>(ROW row)toRowTapCallback<DATA>(DATA data)RowDoubleTapCallback<ROW>(ROW row)toRowDoubleTapCallback<DATA>(DATA data)CellBackgroundBuilder<ROW>(RowData<ROW> data)toCellBackgroundBuilder<DATA>(DaviRow<DATA> row)EasyTableCellBuilder<ROW>(BuildContext context, RowData<ROW> data)toDaviCellBuilder<DATA>(BuildContext context, DaviRow<DATA> row)CellStyleBuilder<ROW>(RowData<ROW> data)toCellStyleBuilder<DATA>(DaviRow<DATA> row)EasyTableIntValueMapper<ROW>(ROW row)toDaviIntValueMapper<DATA>(DATA data)EasyTableDoubleValueMapper<ROW>(ROW row)toDaviDoubleValueMapper<DATA>(DATA data)EasyTableStringValueMapper<ROW>(ROW row)toDaviStringValueMapper<DATA>(DATA data)EasyTableObjectValueMapper<ROW>(ROW row)toDaviObjectValueMapper<DATA>(DATA data)EasyTableIconValueMapper<ROW>(ROW row)toDaviIconValueMapper<DATA>(DATA data)
2.6.0 #
- Migration from
easy_tablepackage (https://pub.dev/packages/easy_table)- Replace import
package:easy_table/easy_table.dartwithpackage:davi/davi.dart
- Replace import
