-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Cupertino fullscreenDialog breaks parallax effect #20073
Comments
Please add the output of |
Oh right, here's the output:
|
And here's a code sample: import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
onGenerateRoute: (RouteSettings settings) {
switch (settings.name) {
case '/':
return CupertinoPageRoute<void>(
builder: (_) => Home(),
settings: settings,
);
}
},
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Home')),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatButton(
child: Text('Page A with fullscreenDialog: false'),
onPressed: () {
Navigator.push(
context,
CupertinoPageRoute<void>(
builder: (_) => PageA(),
fullscreenDialog: false,
));
},
),
SizedBox(height: 25.0),
FlatButton(
child: Text('Page A with fullscreenDialog: true'),
onPressed: () {
Navigator.push(
context,
CupertinoPageRoute<void>(
builder: (_) => PageA(),
fullscreenDialog: true,
));
},
),
],
),
),
);
}
}
class PageA extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Page A')),
body: Center(
child: FlatButton(
child: Text(
'Page B (IMPORTANT: current Page A should move with parallax '
'effect to the left!)',
textAlign: TextAlign.center,
),
onPressed: () {
Navigator.push(
context, CupertinoPageRoute<void>(builder: (_) => PageB()));
},
),
),
);
}
}
class PageB extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Page B')),
body: Padding(
padding: EdgeInsets.all(20.0),
child: Center(
child: Text(
'''\
Please check:
1. This page should enter from the right.
2. Page A should always move to the left with parallax effect.''',
textAlign: TextAlign.center,
),
),
),
);
}
} |
This is sensible. In iOS equivalent, it's a bit convoluted but if your A and B are wrapped in their own UINavigationController and the navigation controller was presented modally and B was shown from A, A would slide up on the way in and slide to the left in a parallax motion on the way out. Should fix in Flutter. |
Issue still exist on flutter doctor -v
|
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
The bug appears with
MaterialPageRoute
on iOS orCupertinoPageRoute
on iOS & Android.We push the following pages in this order via the Navigator:
home -> A -> B
.If A is pushed with
fullscreenDialog: false
and then we push B withfullscreenDialog: false
, B enters the screen from the right and A moves to the left (with parallax effect => everything correct).However, if A is pushed with
fullscreenDialog: true
and then B withfullscreenDialog: false
, B enters the screen from the right, but A has no parallax effect.This makes no sense because when pushing B, the parallax effect for A should only depend on how B enters the screen (from the right => parallax, from the bottom => no parallax). Currently it depends on how A was pushed.
The text was updated successfully, but these errors were encountered: