I have PaginatedDataTable and I put property of source's PaginatedDataTable to another class.. here is the code
class MainPage extends StatefulWidget {
MainPage({Key key}) : super(key: key);
@override
_MainPageState createState() => new _MainPageState();
}
class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: PaginatedDataTable(
header: Center(
child: Text(
'List Data'
)),
onRowsPerPageChanged:...
columns: <DataColumn>[
DataColumn(label: Text('No.')),
DataColumn(label: Text('Data 1')),
DataColumn(label: Text('Data 2'))
],
source: mysource,
rowsPerPage:...
)
)
}
}
and for the mysource:
class MySource extends DataTableSource {
...
}
but the thing that makes me confused is... after I process my data inside class MySource extends DataTableSource
I don't know how to pass the data from there to call it inside MainPage of StateFulWidget.. so is there a way to call data inside class MySource extends DataTableSource
from class MainPage extends StatefulWidget
Write code for your question ,I hope that will helpful.