Skip to main content

responsive_data_grid 1.1.0 copy "responsive_data_grid: ^1.1.0" to clipboard
responsive_data_grid: ^1.1.0 copied to clipboard

Responsive Data Grid for Flutter inspired by Kendo UI's Grid functionality with full filtering, sorting, and paging that also responds dynamically to screen size using the same metaphor as bootstrap grid.

responsive_data_grid #

CI pub package

A Flutter data grid inspired by Kendo UI Grid: paging, sorting, filtering, grouping, and a bootstrap-style 12-column layout.

Companion backends: client_filtering (Dart), the dotnet/ folder (NuGet), and javascript/ (TypeScript). All three speak the same LoadCriteria JSON.

Features #

  • Client-side (items) and server-side (loadData) constructors
  • Paging: pager, infiniteScroll, none, and auto
  • Single- and multi-column sort, menu and row filters, grouping with group footers
  • Aggregates, column visibility, freeze, sticky columns, resize, reorder
  • GridSizing.fill / shrinkWrap / auto for tabbed pages and infinite min/max height
  • ResponsiveDataGridTheme under MaterialApp and CupertinoApp
  • English and Spanish GridLocalizations

Install #

dependencies:
  responsive_data_grid: ^1.1.0
  client_filtering: ^0.0.29

Add GridLocalizations.delegate next to the Flutter delegates.

MaterialApp(
  localizationsDelegates: [
    GridLocalizations.delegate,
    ...GlobalMaterialLocalizations.delegates,
  ],
  supportedLocales: GridLocalizations.supportedLocales,
  home: const MyGridPage(),
);

Getting started #

Always specify the row generic: ResponsiveDataGrid<Order>.

Client-side #

ResponsiveDataGrid<Order>.clientSide(
  items: orders,
  pageSize: 20,
  pagingMode: PagingMode.pager,
  columns: [
    IntColumn(
      fieldName: 'id',
      header: const ColumnHeader(text: 'Id', showFilter: true, showOrderBy: true),
      value: (row) => row.id,
      xsCols: 2,
    ),
    StringColumn(
      fieldName: 'name',
      header: const ColumnHeader(text: 'Name', showFilter: true, showOrderBy: true),
      value: (row) => row.name,
      xsCols: 10,
    ),
  ],
);

Server-side LoadCriteria contract #

loadData receives a LoadCriteria and must return a ListResponse<T> (or null). Honor skip / take for paging. Filters, sorts, groups, and aggregates arrive as lists you can send to your API as JSON or OData (criteria.filterBy.toOdata()).

ResponsiveDataGrid<Order>.serverSide(
  pagingMode: PagingMode.pager,
  pageSize: 25,
  loadData: (criteria) async {
    final page = await api.fetchOrders(
      skip: criteria.skip ?? 0,
      take: criteria.take ?? 25,
      filter: criteria.filterBy,
      orderBy: criteria.orderBy,
      groupBy: criteria.groupBy,
      aggregates: criteria.aggregates,
    );
    return ListResponse<Order>(
      totalCount: page.totalCount,
      items: page.items,
      groups: page.groups,
      aggregates: page.aggregates,
    );
  },
  columns: [ /* same column list */ ],
);

PagingMode.none sends take: maximumRows (default 99999) and omits the pager. On failure, the grid keeps its height, shows a retry overlay, and calls onLoadError.

Paging #

Mode Behavior
pager One page of pageSize rows plus a pager
infiniteScroll Loads the next page as the user scrolls. Needs a bounded height, or set minHeight / maxHeight
none Loads up to maximumRows in one request
auto Infinite scroll when the host height is bounded (including an explicit height); pager when the parent is a scroll view. GridSizing.fill and shrinkWrap force pager

Height and scrolling #

  • GridSizing.auto (default): height if set, otherwise fill a bounded parent or shrink-wrap in a scroll view
  • GridSizing.fill: never shorter than one page of rows plus header, filter row, groups, footers, and pager. A taller parent is filled. A short tight parent keeps an inner body scrollbar. An unbounded parent (tab ListView) uses that minimum so the host scrolls
  • GridSizing.shrinkWrap: size to the current page; the host scrolls
  • Infinite scroll clamps the entire grid between minHeight and maxHeight, including inside an unbounded parent

ResponsiveDataGridState.minimumHeight is the computed floor.

Grouping and infinite scroll #

Grouped pager bodies pin the current group header while its rows scroll. Infinite scroll keeps group headers, nested groups, and group footers. Client-side grouped infinite scroll pages groups, not raw rows. A server loadData should return the same shape: ListResponse.groups for the requested skip/take of groups.

Row pin, sticky rows, and row reorder apply to the ungrouped pager only.

Theming #

ThemeData(
  useMaterial3: true,
  colorScheme: ColorScheme.fromSeed(seedColor: Colors.teal),
  extensions: [
    ResponsiveDataGridTheme.fromTheme(
      ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.teal)),
    ),
  ],
);

fromCupertino does the same under CupertinoApp. Override individual tokens (header colors, pager icons, footer padding) on the extension. Empty grids show themed "No records available." chrome; noResults replaces that template.

The example app switches Light / Dark / Branded palettes from the kitchen-sink app bar.

Screenshots #

[Kitchen sink with grouping, filters, multi-sort, search, and pager]

Kitchen sink: grouping, filters, multi-column sort, toolbar, and pager.

[Example catalog grouped by Overview, Data, Paging, Height, and Columns]

Example catalog. Jump to a screen with --dart-define=DEMO_SCREEN=<id>.

Example app #

cd responsive_data_grid/example
flutter run

The home catalog is grouped into Overview, Data, Paging, Height, and Columns. Jump to a screen with --dart-define=DEMO_SCREEN=<id> (see example/README.md).

Additional packages #

For a C# WebAPI that turns LoadCriteria into a LINQ / Entity Framework expression tree, see the dotnet/ folder. TypeScript lives in javascript/.

7
likes
0
points
1.41k
downloads

Publisher

verified publisherconcerti.io

Weekly Downloads

Responsive Data Grid for Flutter inspired by Kendo UI's Grid functionality with full filtering, sorting, and paging that also responds dynamically to screen size using the same metaphor as bootstrap grid.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

bootstrap_grid, client_filtering, cupertino_ui, darq, date_field, flutter, infinite_scroll_pagination, intl, material_ui

More

Packages that depend on responsive_data_grid