table_sticky_headers 1.1.1 table_sticky_headers: ^1.1.1 copied to clipboard
Two-dimension table with both sticky headers. You may scroll left \ right and top \ bottom. Sticky headers always stay visible. Legend cell (top left) always visible too.
table_sticky_headers #
This package for Flutter allows you to display two-dimension table with both sticky headers.
Key of this package is sticky headers. Cells aren't much customizable now. It's quite easy to see in separate class all parameters and change them. In future I plan to add customization in table constructor. Feature requests and PRs are welcome.
Usage example:
import 'package:flutter/material.dart';
import 'package:table_sticky_headers/table_sticky_headers.dart';
void main() => runApp(TableSimple());
class TableSimple extends StatelessWidget {
final List<String> columns = List.generate(10, (i) => '${i + 1}');
final List<String> rows = List.generate(20, (i) => '${i + 1}');
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Sticky Headers Two-Dimension Table'),
backgroundColor: Colors.amber,
),
body: StickyHeadersTable(
columnsLength: columns.length,
rowsLength: rows.length,
columnsTitleBuilder: (i) => Text('Top ${columns[i]}'),
rowsTitleBuilder: (i) => Text('Left ${rows[i]}'),
contentCellBuilder: (i, j) => Text('T${columns[i]} : L${rows[j]}'),
legendCell: Text('Sticky Legend'),
),
),
);
}
}
Support #
Please file issues and feature requests.
Getting Started #
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.