flutter_table_plus 1.14.2
flutter_table_plus: ^1.14.2 copied to clipboard
A highly customizable and efficient table widget for Flutter, featuring synchronized scrolling, theming, sorting, selection, and column reordering.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'pages/table_example_page.dart';
import 'pages/comprehensive_merged_example.dart';
import 'pages/sortable_example.dart';
import 'pages/dynamic_height_example.dart';
import 'pages/frozen_columns_demo.dart';
import 'pages/expandable_summary_example.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Table Plus Example',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const ExampleHomePage(),
);
}
}
class ExampleHomePage extends StatelessWidget {
const ExampleHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter Table Plus Examples'),
backgroundColor: Colors.blue.shade100,
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Card(
child: ListTile(
leading: const Icon(Icons.table_chart),
title: const Text('Basic Table Example'),
subtitle: const Text('Standard table with all features'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const TableExamplePage(),
),
);
},
),
),
const SizedBox(height: 8),
Card(
child: ListTile(
leading: const Icon(Icons.merge_type),
title: const Text('Comprehensive Merged Table'),
subtitle: const Text(
'All features: sorting, editing, selection, reordering, theming'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ComprehensiveMergedExample(),
),
);
},
),
),
const SizedBox(height: 8),
Card(
child: ListTile(
leading: const Icon(Icons.sort),
title: const Text('Sortable Table'),
subtitle: const Text(
'Table with sorting functionality and 10 sample records'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SortableExample(),
),
);
},
),
),
const SizedBox(height: 8),
Card(
child: ListTile(
leading: const Icon(Icons.height),
title: const Text('Dynamic Height Table'),
subtitle:
const Text('TextOverflow.visible with dynamic heights'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DynamicHeightExample(),
),
);
},
),
),
const SizedBox(height: 8),
Card(
child: ListTile(
leading: const Icon(Icons.lock),
title: const Text('Frozen Columns Demo'),
subtitle: const Text(
'Fixed columns with horizontal scroll, sorting, selection, editing'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const FrozenColumnsDemo(),
),
);
},
),
),
const SizedBox(height: 8),
Card(
child: ListTile(
leading: const Icon(Icons.expand_more, color: Colors.purple),
title: const Text('Expandable Summary Example'),
subtitle:
const Text('Merged rows with expandable summary totals'),
trailing: const Icon(Icons.arrow_forward_ios),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ExpandableSummaryExample(),
),
);
},
),
),
],
),
),
);
}
}