flutter_table_plus 1.0.0 copy "flutter_table_plus: ^1.0.0" to clipboard
flutter_table_plus: ^1.0.0 copied to clipboard

A highly customizable and efficient table widget for Flutter, featuring synchronized scrolling, theming, sorting, selection, and column reordering.

Flutter Table Plus #

pub version license Flutter platforms style: flutter lint github stars

A highly customizable and efficient table widget for Flutter. It provides a rich set of features including synchronized scrolling, sorting, selection, and advanced theming, making it easy to display complex data sets.


Features #

  • Synchronized Scrolling: Header and body scroll horizontally in perfect sync.
  • Advanced Theming: Customize headers, rows, scrollbars, and selection styles with TablePlusTheme.
  • Column Sorting: Supports multi-state sorting (ascending, descending, none).
  • Row Selection: Enable single or multi-row selection with checkboxes.
  • Column Reordering: Easily reorder columns with drag-and-drop.
  • Custom Cell Widgets: Render any widget inside a cell using cellBuilder for maximum flexibility.
  • Safe Column Management: Use TableColumnsBuilder to define columns and manage their order without conflicts.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_table_plus: ^1.0.0

Then, run flutter pub get in your terminal.

Basic Usage #

Here's a simple example of how to create a table.

import 'package:flutter/material.dart';
import 'package:flutter_table_plus/flutter_table_plus.dart';

class BasicTablePage extends StatelessWidget {
  const BasicTablePage({super.key});

  // 1. Define your columns using the builder
  final Map<String, TablePlusColumn> columns = const TableColumnsBuilder()
      .addColumn('id', TablePlusColumn(key: 'id', label: 'ID', order: 0, width: 80))
      .addColumn('name', TablePlusColumn(key: 'name', label: 'Name', order: 0, width: 150))
      .addColumn('department', TablePlusColumn(key: 'department', label: 'Department', order: 0, width: 200))
      .build();

  // 2. Prepare your data as a List of Maps
  final List<Map<String, dynamic>> data = const [
    {'id': 1, 'name': 'John Doe', 'department': 'Engineering'},
    {'id': 2, 'name': 'Jane Smith', 'department': 'Marketing'},
    {'id': 3, 'name': 'Peter Jones', 'department': 'Sales'},
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Basic Table Example')),
      body: FlutterTablePlus(
        columns: columns,
        data: data,
        theme: const TablePlusTheme(
          headerTheme: TablePlusHeaderTheme(height: 48),
          bodyTheme: TablePlusBodyTheme(rowHeight: 48),
        ),
      ),
    );
  }
}

Detailed Documentation #

For more advanced use cases and detailed guides, please refer to our documentation:

  • State Management

    • Integrating with Riverpod (Code Generator)
  • Feature Guides

    • Sorting
    • Row Selection
    • Theming and Styling
    • Advanced Column Settings
3
likes
0
points
563
downloads

Publisher

unverified uploader

Weekly Downloads

A highly customizable and efficient table widget for Flutter, featuring synchronized scrolling, theming, sorting, selection, and column reordering.

Repository (GitHub)
View/report issues

Topics

#table #datatable #data-table #grid #datagrid

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_table_plus