Repository navigation
Transition animation curves used by Cupertino are outdated #122247
Copy link
Copy link
Closed
Labels
found in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
CupertinoPageRoute animations are now outdated and don't feel native to the user.
Related to the #22862
Expected results:
Transition animation being close to native.
Actual results:
- Transition duration is 100 ms shorter than native iOS.
- Native transition starts slowly and quickly accelerates, rather than being linear from the beginning.
Code sample
import 'package:flutter/cupertino.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(
title: 'Cupertino App',
home: CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Cupertino App Bar'),
),
child: Center(
child: Builder(builder: (context) {
return CupertinoButton(
child: const Text('Next Page'),
onPressed: () {
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => const SecondPage()),
);
},
);
}),
),
),
);
}
}
class SecondPage extends StatelessWidget {
const SecondPage({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Second Page'),
),
child: Center(
child: CupertinoButton(
child: const Text('Back'),
onPressed: () {
Navigator.pop(context);
},
),
),
);
}
}
RPReplay_Final1678315602.mov
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
found in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Activity
darshankawar commentedon Mar 9, 2023
@ivirtex
Can you provide a minimal code sample that highlights the behavior you are reporting along with expected result that you are looking for ?
ivirtex commentedon Mar 9, 2023
@darshankawar Sure, I updated the description.
darshankawar commentedon Mar 9, 2023
Thanks for the code sample. I noticed that the transition animation is a bit faster than native if I understood the issue correctly.
stable, master flutter doctor -v
bernaferrari commentedon Mar 9, 2023
Out of curiosity, how did you make the blue green sample? Specifically the chart. Really awesome.
ivirtex commentedon Mar 9, 2023
@bernaferrari Thanks!
This app has overlaid iOS platform view which sends its ViewController's position relative to the screen via a platform channel every frame. Flutter measures relative position of own pages in a similar way.
Then, data sent by iOS and Flutter is captured and drawn using a
CustomPainter.Whole tool has been merged in flutter/platform_tests#18, so you can check details of the implementation or try it yourself :)
github-actions commentedon Apr 17, 2023
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
flutter doctor -vand a minimal reproduction of the issue.