What is onGenerateRoute in Flutter?

onGenerateRoute property Null safety The route generator callback used when the app is navigated to a named route . If this returns null when building the routes to handle the specified initialRoute, then all the routes are discarded and Navigator. defaultRouteName is used instead ( / ). See initialRoute.

Read more