Back button isn't working with a hierarchal route Back button isn't working with a hierarchal route dart dart

Back button isn't working with a hierarchal route


Basically your users route is still active when you go from /user/1 to /user.

To handle list as you want you should define another mount entry :

class RouterExample {  void call(Router router, ViewFactory views) {    views.configure({      'users': ngRoute(        path: '/user',        mount: {          'view' : ngRoute(            path: '/:id',            enter: (_) => print('Show a user'),            leave: (_) => print('Hide user')          ),          'list': ngRoute(            path: '',            enter: (_) => print('Show list of users'),            leave: (_) => print('Hide list of users')          )        }      )    });  }}