redirect method
Meant to be used from with onBeforeUpdate
inside of StackRouteBuilder,
Changes path in the next frame to avoid errors when building mid-build.
Implementation
void redirect(String path, {VoidCallback? onComplete}) async => scheduleMicrotask(() {
this.path = path;
onComplete?.call();
});