Skip to content

[animation] CupertinoPageRoute's pop animation is janky with 2.8 on iOS #95986

@AlexV525

Description

@AlexV525

Could be related to #91937. The same animation is working well with 2.5.

Step to reproduce

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 const MaterialApp(title: 'Test App Demo', home: _Page());
  }
}

class _Page extends StatefulWidget {
  const _Page({Key? key}) : super(key: key);

  @override
  _PageState createState() => _PageState();
}

class _PageState extends State<_Page> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('$hashCode')),
      body: Center(
        child: TextButton(
          onPressed: () {
            Navigator.of(context).push<void>(
              CupertinoPageRoute<void>(builder: (_) => const _Page()),
            );
          },
          child: const Text('Test push'),
        ),
      ),
    );
  }
}
  1. Run this code example on iOS devices, no matter with debug/profile/release mode.
  2. Press the "Test push" button, wait until the page route animation is finished.
  3. Swipe the page from left to right, which is the same behavior with iOS native.
  4. The janky animation should be shown now.
D7F577B8443E502746F5EEC38AA99508.mp4

Additional steps

  1. If you complete the swipe with no pauses during the swipe, the animation will keep janky in the whole process.
  2. Once you paused during the swipe, hold the pressing for a while then continue the swipe, the animation will become smooth as before.
24735335B61FE451F5FE998970205291.mp4

Environments

Target Platform: iOS, and only happened on iOS devices.
Target OS version/browser: iOS 15.2 (shouldn't matter in this case)
Devices: iPhone 12

This is reproducible on the latest master too.

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale zh-Hans-CN)
    • Flutter version 2.8.1 at /Users/alex/Documents/flutter-stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (2 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: animationAnimation APIsc: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.f: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 2.6Found to occur in 2.6found in release: 2.9Found to occur in 2.9platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions