I just wanted to upload an example of a Data Table widget that others can use, its something I struggled to get working for awhile.
[datatable.png]
Just remember when using the widget had to be wrapped in a container otherwise you will just get an invisible error.
The Custom Widget Code is below
import 'dart:math';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({
Key? key,
this.width,
this.height,
}) : super(key: key);
final double? width;
final double? height;
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
title: 'DataTable Example',
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State createState() => _HomePageState();
}
class _HomePageState extends State {
// Generate a list of fiction prodcts
final List