2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-14 11:15:26 +00:00

Pop to the previous context if the stock item is "bad"

This commit is contained in:
Oliver Walters
2022-03-26 17:38:30 +11:00
parent 0b3e716827
commit faf8e45138
12 changed files with 60 additions and 50 deletions

View File

@ -41,21 +41,21 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
// Function called after the widget is first build
Future<void> onBuild(BuildContext context) async {
refresh();
refresh(context);
}
// Function to request data for this page
Future<void> request() async {
Future<void> request(BuildContext context) async {
return;
}
Future<void> refresh() async {
Future<void> refresh(BuildContext context) async {
setState(() {
loading = true;
});
await request();
await request(context);
setState(() {
loading = false;
@ -100,7 +100,9 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
body: Builder(
builder: (BuildContext context) {
return RefreshIndicator(
onRefresh: refresh,
onRefresh: () async {
refresh(context);
},
child: getBody(context)
);
}