Skip to content

Instantly share code, notes, and snippets.

@kirshiyin89
Created September 30, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirshiyin89/9994346c29dd49f82adb8e208cbb8791 to your computer and use it in GitHub Desktop.
Save kirshiyin89/9994346c29dd49f82adb8e208cbb8791 to your computer and use it in GitHub Desktop.
the datatablewidget state class holding the data table
class _DataTableWidgetState extends State<DataTableWidget> {
_DataTableWidgetState(this.listOfColumns);
final Future<List<ConfigData>> listOfColumns;
@override
Widget build(BuildContext context) {
return FutureBuilder<List<ConfigData>>(
future: this.listOfColumns,
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
return CircularProgressIndicator();
default:
return generateTable(context, snapshot.data);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment