AppRoute Function([dynamic args]) getRouteForPath(String path) { final route = routes[path]; if (route == null) { return ([args]) => const NotFoundRoute(); } return route; }