I've been trying to use transitions within my RouteGenerator and didn't had any success yet, in my material design I'm just calling the route with the onGenerateRoute using only the "/" string. I would like to use the cupertinoPageRoute transition and tried passing it inside the MaterialPageRoute with the builder inside it.

class RouteGenerator {
 static Route<dynamic> generateRoute(RouteSettings settings) {

  switch (settings.name) {
    case '/':
      return MaterialPageRoute(builder: (_) => Menu()); }
  }
}


Solution 1: Frenco

You can do this.

class RouteGenerator {
  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case '/':
        return CupertinoPageRoute(
          builder: (_) => Menu(),
        );
    }
  }
}