Issue
The default flutter animation to transit a new page into the focus is to slide it up from the bottom. How do i change this behaviors and slide the new page in from the right or left instead?
Navigator.push(
context,
new PageRouteBuilder(
pageBuilder: (BuildContext context, _, __) {
return new SearchView();
}
)
);
Solution
Check out the CupertinoPageRoute:
A modal route that replaces the entire screen with an iOS transition.
The page slides in from the right and exits in reverse. The page also shifts to the left in parallax when another page enters to cover it.
The page slides in from the bottom and exits in reverse with no parallax effect for fullscreen dialogs.
There's a demo of it in the flutter gallery example app:
Navigator.of(context, rootNavigator: true).push(
new CupertinoPageRoute<bool>(
fullscreenDialog: true,
builder: (BuildContext context) => new Tab3Dialog(),
),
);
Answered By - Danny Tuppeny
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.