0

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()); }
  }
}

1 Answers1

0

You can do this.

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