First of all, thanks for the package, it works great and it's pretty simple to use and implement. And the middleware feature rocks.
After setting it in my project I am facing an issue. Given the following code:
import 'package:flutter/material.dart';
import 'package:qlevar_router/qlevar_router.dart';
void main() => runApp(App());
class App extends StatelessWidget {
App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) => MaterialApp.router(
routeInformationParser: const QRouteInformationParser(),
routerDelegate: QRouterDelegate(
_router,
initPath: '/home',
),
);
static final _router = [
QRoute.withChild(
name: 'home',
path: '/home',
builderChild: (router) {
return Container(
child: router,
);
},
initRoute: '/login',
children: [
QRoute(
name: 'home_login',
path: '/login',
builder: () {
return Center(child: MaterialButton(
child: Text('Go to vendor login'),
onPressed: () { QR.to('/vendor'); },
),);
},
),
],
),
QRoute.withChild(
name: 'vendor',
path: '/vendor',
builderChild: (router) {
return Container(
child: router,
);
},
initRoute: '/login',
children: [
QRoute(
name: 'vendor_login',
path: '/login',
builder: () {
return Text('Vendor login');
},
),
]
)
];
}
Once you go to login (/vendor/login) inside vendor page from login (/home/login) in home page, you can't pop back. If you do it, the web url updates but the widget remains, unless you pop twice.