Skip to content
All packages

// Package

nicetables

Feature-complete, theme-aware data tables for Flutter. One typed column definition drives sorting, search, filters, pagination, selection and a responsive card layout.

likes
1
pub points
150/160
downloads in 30 days
784

Platforms

  • Android
  • iOS
  • Web
  • macOS
  • Windows
  • Linux
A transactions table with a search box, status chips, progress bars and numbered pages

What it does

nicetables gives a Flutter app a production data table in a few lines. You describe each column once, with a typed value callback, and the table derives sorting, search, filtering, CSV export and the card layout for narrow screens from that single definition. Dark mode and brand colours come from Theme.of(context) with no setup.

Features

  • Typed columns: text, number, money, date, status, boolean, actions and custom columns, each with its own width policy.
  • One controller: NiceTableController owns sort, search, filters, page, selection, expansion, column visibility and density. Pass your own to read or drive it, or let the table make one.
  • Client or server data: client-side processing is automatic. For a backend, NiceAsyncTable takes a fetch callback and handles loading, errors and retries.
  • Toolbar: title and live row count, search, filter chips, a column picker, a density menu, CSV export and refresh, which can show your app's own loader while the table reloads. With rows selected it becomes a bulk-action bar.
  • Footer: a rows-per-page menu, numbered pages with the current one highlighted and a go-to-page field.
  • Rows and columns: hover, selected and striped states, expandable detail panels, pinned leading columns and drag-to-resize handles.
  • Keyboard: arrow keys, Home/End, PageUp/PageDown, Space to select and Enter to open.
  • Responsive: below a breakpoint, rows become cards.
  • Themed and localisable: NiceTableTheme is a ThemeExtension derived from your ColorScheme, and every piece of text the table draws lives in NiceTableStrings.
  • Accessible: semantic labels on sort buttons, checkboxes and rows, and contrast-checked status colours.
  • Pure Flutter: no native code and no dependencies beyond meta.

Install

flutter pub add nicetables

Requires Flutter 3.27 or newer.

Use it

import 'package:nicetables/nicetables.dart';

NiceTable<Order>(
  title: 'Orders',
  rows: orders,
  columns: [
    NiceColumn.text('id', 'Order', (o) => o.id, mono: true),
    NiceColumn.text('customer', 'Customer', (o) => o.customer),
    NiceColumn.status('status', 'Status', (o) => o.statusValue),
    NiceColumn.money('total', 'Total', (o) => o.total),
    NiceColumn.date('placed', 'Placed', (o) => o.placedAt),
  ],
  selectionMode: NiceSelectionMode.multi,
  onRowTap: openOrder,
)

For data that lives on a server, swap in NiceAsyncTable:

NiceAsyncTable<Order>(
  fetch: (q) async {
    final page = await api.orders(
      offset: q.offset,
      limit: q.pageSize,
      search: q.search,
    );
    return NicePage(rows: page.items, total: page.total);
  },
  columns: columns,
)

The full API is documented on pub.dev.

Screenshots

  • A hovered row with its detail panel open under it
  • The same table in dark mode
  • Three rows selected, with the toolbar turned into a bulk-action bar
  • The compact density, which fits more rows on the screen
  • A table that fetches each page from a server
  • The card layout that replaces rows on a narrow screen