Separate onBuild and refresh callbacks

This commit is contained in:
Oliver Walters committed 2020-04-15 12:47:17 +10:00
1 parent 90a39ae3de
commit 93630ea910
5 files changed
+35 -15

No files matched your search

+6 -1
View File
@@ -15,7 +15,12 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) => request(context));
WidgetsBinding.instance.addPostFrameCallback((_) => onBuild(context));
}
// Function called after the widget is first build
Future<void> onBuild(BuildContext context) async {
return;
}
// Function to request data for this page