I want my DataTable to do exactly what the ListView.builder does. This build method iterates an index and also will take my object while for the life of me I can't figure this out for the DataTable in my situation. As evidence here and here.
My ultimate goal is to use my Hive box to dynamically add data to DataTable rows using an index iteration.
So I discovered that the build method can be referenced and accessed, and this is the exact functionality I need and want. This (indexing) should ABSOLUTELY be a standard optional property for DataTable, but it's not.
/// Signature for a function that creates a widget for a given index, e.g., in a
/// list.
///
/// Used by [ListView.builder] and other APIs that use lazily-generated widgets.
///
/// See also:
///
/// * [WidgetBuilder], which is similar but only takes a [BuildContext].
/// * [TransitionBuilder], which is similar but also takes a child.
typedef IndexedWidgetBuilder = Widget Function(BuildContext context, int index);
Is it possible to implement this so it can be used in a function that returns a DataTable? How can this be done?
Help MUCH MUCH appreciated! Racking my braains over this.