PagedDataTable<TKey extends Comparable, TResultId extends Comparable, TResult extends Object> class
A paginated DataTable that allows page caching and filtering
TKey is the type of the page token
TResult is the type of data the data table will show.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- PagedDataTable
- Available extensions
Constructors
-
PagedDataTable({Future downloadPage({Map<
String, dynamic> ? orderBy, Map<String, dynamic> ? searchBy})?, String? downloadButtonText, IconData? downloadButtonIcon, required Future<(List< fetchPage({Map<TResult> , Pagination?)>String, dynamic> ? orderBy, int? page, int? perPage, Map<String, dynamic> ? searchBy}), required TKey initialPage, required List<BaseTableColumn< columns, required ModelIdGetter<TResult> >TResultId, TResult> idGetter, TextTableFilter? mainFilter, List<TableFilter> ? extraFilters, List<Widget> mainMenus = const [], List<TableExtraMenu< extraMenus = const [], PagedDataTableController<Object> >TKey, TResultId, TResult> ? controller, Widget? header, PagedDataTableThemeData? theme, List<int> ? pageSizes, int? initialPageSize, ErrorBuilder? errorBuilder, WidgetBuilder? noItemsFoundBuilder, bool rowsSelectable = true, bool selectAllInHeader = true, CustomRowBuilder<TResult> ? customRowBuilder, Stream? refreshListener, dynamic onItemTap(TResult)?, List<TableAction< tableActions = const [], List<TResult> >TableAction< actionsBuilder(TResult item)?, bool isFilterBarVisible = true, bool isInSnippet = false, dynamic actionsTitle(TResult)?, bool showBorder = false, bool showTopBorder = true, bool embedded = false, bool isFilterBarRounded = true, bool hoistFilterBarToShell = false, bool showShimmerLoading = true, Widget expandedRowBuilder(BuildContext context, TResult item)?, Future<TResult> >void> onRowExpanded(TResult item)?, List<Widget> selectionActionsBuilder(BuildContext context, int selectedCount, List<TResult> selectedItems)?, String? title, Widget? titleWidget, Widget? titleIcon, TextStyle? titleStyle, Color? titleBackgroundColor, List<Widget> titleActions = const [], Color? primaryColor, bool fillHeight = false, bool infiniteScroll = false, ScrollController? pageScrollController, CLTableStyle? style, Key? key}) -
const
Properties
-
actionsBuilder
→ List<
TableAction< Function(TResult item)?TResult> > -
A function that builds table actions based on the current item
final
- actionsTitle → dynamic Function(TResult)?
-
final
-
columns
→ List<
BaseTableColumn< TResult> > -
The list of columns to display.
final
-
controller
→ PagedDataTableController<
TKey, TResultId, TResult> ? -
A custom controller used to programatically control the table.
final
-
customRowBuilder
→ CustomRowBuilder<
TResult> ? -
A custom builder that builds a row.
final
- downloadButtonIcon → IconData?
-
final
- downloadButtonText → String?
-
final
-
downloadPage
→ Future Function({Map<
String, dynamic> ? orderBy, Map<String, dynamic> ? searchBy})? -
final
- embedded → bool
-
Se true la tabella NON disegna la propria card (sfondo/ombra/bordo/raggio):
pensata per essere annidata in un CLContainer che fornisce gia' la superficie.
final
- errorBuilder → ErrorBuilder?
-
A custom builder that display any error.
final
- expandedRowBuilder → Widget Function(BuildContext context, TResult item)?
-
Builder opzionale per mostrare contenuto espanso sotto la riga
final
-
extraFilters
→ List<
TableFilter> ? -
The list of filters to show.
final
-
extraMenus
→ List<
TableExtraMenu< Object> > -
A custom menu tooltip to show in the filter bar.
final
-
fetchPage
→ Future<
(List< Function({Map<TResult> , Pagination?)>String, dynamic> ? orderBy, int? page, int? perPage, Map<String, dynamic> ? searchBy}) -
The callback that gets executed when a page is fetched.
final
- fillHeight → bool
-
Se true la tabella riempie l'altezza del parent (che DEVE essere bounded,
es. dentro un
Expanded): filter bar, header e footer restano fissi e scorrono solo le righe. Se false (default) la tabella è alta quanto il contenuto e scorre col parent.final - hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
A custom widget to build in the footer, aligned to the left.
final
- hoistFilterBarToShell → bool
-
Opt-in: su mobile (compact) e con un
CLShellScopeantenato, la filter bar non si renderizza inline ma pubblica i suoi controlli nell'area contestuale dello shell (riga alta sopra la bottom bar). Default false → comportamento invariato per ogni tabella esistente (zero blast radius).final -
idGetter
→ ModelIdGetter<
TResultId, TResult> -
A function that returns the id of an item.
final
- infiniteScroll → bool
-
Se true abilita l'infinite scroll: la lista possiede lo scroll (come
fillHeight) e carica la pagina successiva quando ci si avvicina al fondo
(
nextPage(isInfiniteScroll: true)→ append), con loader in coda e footer di paginazione nascosto. Il parent DEVE dare un'altezza bounded alla tabella (es.Expanded). Opt-in su tutti i breakpoint.final - initialPage → TKey
-
The initial page to fetch.
final
- initialPageSize → int?
-
final
- isFilterBarRounded → bool
-
final
- isFilterBarVisible → bool
-
final
-
final
- isInSnippet → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainFilter → TextTableFilter?
-
final
-
mainMenus
→ List<
Widget> -
final
- noItemsFoundBuilder → WidgetBuilder?
-
A custom builder that builds when no item is found.
final
- onItemTap → dynamic Function(TResult)?
-
final
-
onRowExpanded
→ Future<
void> Function(TResult item)? -
Callback chiamata quando una riga viene espansa
final
- pageScrollController → ScrollController?
-
ScrollController della PAGINA, per il caso "scroll della pagina, non della
tabella" (
infiniteScrollsenzafillHeight). Se fornito, la tabella gestisce internamente l'auto-fill (carica finché il viewport è pieno) e il load a fine scroll: la pagina passa solo il controller, niente plumbing manuale.final -
pageSizes
→ List<
int> ? -
final
- primaryColor → Color?
-
Colore primario applicato agli elementi interattivi della tabella
(indicatore di sort, riga selezionata, checkbox, hover, badge filtri,
toolbar di selezione, empty state).
Se null, viene usato
CLTheme.of(context).primary.final - refreshListener → Stream?
-
A stream to listen and refresh the table when any update is received.
final
- rowsSelectable → bool
-
Indicates if the table allows the user to select rows.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectAllInHeader → bool
-
Mostra il checkbox "seleziona tutti" nell'header. Default true. Se false
resta lo slot (allineamento) ma niente select-all: la selezione avviene
solo per-riga. Le checkbox di riga restano sempre attive con rowsSelectable.
final
-
selectionActionsBuilder
→ List<
Widget> Function(BuildContext context, int selectedCount, List<TResult> selectedItems)? -
Builder opzionale per le azioni nella toolbar di selezione (appare quando almeno una riga è selezionata).
Ritorna solo i widget delle azioni: badge "X selezionati" e "Deseleziona tutto" vengono
gestiti internamente dalla tabella.
final
- showBorder → bool
-
final
-
final
- showShimmerLoading → bool
-
final
- showTopBorder → bool
-
final
- style → CLTableStyle?
-
Override colori per-istanza (vedi CLTableStyle). Null -> token CLTheme.
final
-
tableActions
→ List<
TableAction< TResult> > -
final
- theme → PagedDataTableThemeData?
-
A custom theme to apply only to this DataTable instance.
final
- title → String?
-
Titolo opzionale mostrato nell'header della tabella (stessa grafica di CLContainer).
final
-
titleActions
→ List<
Widget> -
Azioni opzionali mostrate nella STESSA riga del titolo, allineate a destra,
sopra la filter bar/ricerca. L'header del titolo compare anche se è
valorizzato solo questo (senza title/titleWidget).
final
- titleBackgroundColor → Color?
-
Colore di sfondo dell'header del titolo (applicato con alpha 0.08).
final
- titleIcon → Widget?
-
Icona opzionale mostrata a sinistra del title. Ignorata se titleWidget è valorizzato.
final
- titleStyle → TextStyle?
-
Override stile del title. Default
theme.heading2.final - titleWidget → Widget?
-
Widget custom da mostrare al posto di title. Ha precedenza su title e titleIcon.
final
Methods
-
animateOnActionTrigger(
AnimationInfo animationInfo, {bool hasBeenTriggered = false}) → Widget -
Available on Widget, provided by the AnimatedWidgetExtension extension
-
animateOnPageLoad(
AnimationInfo animationInfo) → Widget -
Available on Widget, provided by the AnimatedWidgetExtension extension
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited