2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Separate onBuild and refresh callbacks

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

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