I am using typed routes with go_router
in flutter.
I show a loading spinner like this:
showDialog<void>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return const Dialog(
backgroundColor: Colors.transparent,
elevation: 0,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
),
),
);
},
);
Afterwards I push a page.
await goRouter.push(
const RouteEditPage().location,
extra: (
...
),
);
I want the new page to be above the loading spinner. Because in this page I add some values and get return values back or an error. And after the page is closed the spinner should still be going for a while until some process finished.
At the moment the loading dialog is always on top. Even though I push the page later the dialog seems to be at the topmost spot at the stack.
How can I change that?