Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetRoute Duration doesn't seem to work #38

Closed
jlubeck opened this issue Apr 15, 2020 · 4 comments
Closed

GetRoute Duration doesn't seem to work #38

jlubeck opened this issue Apr 15, 2020 · 4 comments

Comments

@jlubeck
Copy link

jlubeck commented Apr 15, 2020

I'm trying to use custom transitions on named routes:

class Router {
  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case Routes.PriorityHome:
        return GetRoute(
          settings: settings,
          page: PriorityHomeScreen(),
          duration: Duration(milliseconds: 0),
        );
      case Routes.PriorityPatient:
        return GetRoute(
          settings: settings,
          page: PriorityPatientScreen(),
          duration: Duration(milliseconds: 0),
        );
      default:
        return GetRoute(
          settings: settings,
          transition: Transition.fade,
          page: Scaffold(
            body: Center(
              child: Text('No route defined for ${settings.name}'),
            ),
          ),
        );
    }
  }
}

My expectation is for no animation to occur (since milliseconds is 0), but it is still happening.
Changing the value to other values (higher than the default 400 for example) doesn't change anything either

@jonataslaw
Copy link
Owner

This is a known error. In the last update of Flutter to beta / dev / master I had to restructure the whole GetRoute, and one of the sacrificed functions was the duration. In yesterday's update on stable, to keep the same base, I also temporarily removed the support for duration, however, I already found a way around this and it will be released in the next update.

@jlubeck
Copy link
Author

jlubeck commented Apr 15, 2020

Nice! Looking forward to it

@jonataslaw
Copy link
Owner

Fix on Lastest version

@jlubeck
Copy link
Author

jlubeck commented Apr 16, 2020

You didn't ask, but I confirmed it's working :D

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants