GoNavigator constructor
GoNavigator({})
Creates a new instance of NavigationRouteBuilder
to manage routes in the application.
initialRoute
: The widget that represents the initial route of the application.routes
: A map that associates route names with corresponding widget constructors.
Throws an exception if the routes
map is empty.
Implementation
GoNavigator({
required this.initialRoute,
required this.routes,
}) {
if (routes.isEmpty) {
throw Exception('Routes map cannot be empty.');
}
if (initialRoute == null) {
throw Exception('Routes map cannot be empty.');
}
}