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

Cupertino fullscreenDialog breaks parallax effect #20073

Closed
wkornewald opened this issue Aug 1, 2018 · 6 comments · Fixed by #50180
Closed

Cupertino fullscreenDialog breaks parallax effect #20073

wkornewald opened this issue Aug 1, 2018 · 6 comments · Fixed by #50180
Labels
a: fidelity Matching the OEM platforms better f: cupertino flutter/packages/flutter/cupertino repository f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically

Comments

@wkornewald
Copy link

The bug appears with MaterialPageRoute on iOS or CupertinoPageRoute 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 with fullscreenDialog: 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 with fullscreenDialog: 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.

@zoechi
Copy link
Contributor

zoechi commented Aug 1, 2018

Please add the output of flutter doctor -v.
The source for a minimal reproduction would be helpful.

@wkornewald
Copy link
Author

Oh right, here's the output:

[√] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.17134.165], locale en-DE)
    • Flutter version 0.5.1 at C:\Users\wkornewald\Documents\Applications\flutter
    • Framework revision c7ea3ca377 (9 weeks ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at C:\Users\wkornewald\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Aug 1, 2018
@wkornewald
Copy link
Author

wkornewald commented Aug 1, 2018

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,
          ),
        ),
      ),
    );
  }
}

@xster xster added the a: fidelity Matching the OEM platforms better label Aug 2, 2018
@xster
Copy link
Member

xster commented Aug 2, 2018

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.

@xster xster added this to Easy fix in iOS Framework Aug 31, 2018
@zoechi zoechi added this to the Goals milestone Jan 29, 2019
@jmagman jmagman added this to Awaiting Triage in Mobile - iOS fidelity review Feb 25, 2020
@TahaTesser TahaTesser added f: routes Navigator, Router, and related APIs. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically labels Mar 27, 2020
@TahaTesser
Copy link
Member

Issue still exist on

flutter doctor -v

[✓] Flutter (Channel dev, v1.16.2, on Mac OS X 10.15.4 19E266, locale en-GB)
    • Flutter version 1.16.2 at /Users/taha/Code/flutter_dev
    • Framework revision 58cad787d8 (4 days ago), 2020-03-23 08:33:41 -0700
    • Engine revision 2d42c74a34
    • Dart version 2.8.0 (build 2.8.0-dev.16.0 ba8baa46b4)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/taha/Code/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/taha/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.9.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.43.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.1

[✓] Connected device (4 available)
    • Taha’s iPhone • 00008020-001059882212002E • ios            • iOS 13.4
    • macOS         • macOS                     • darwin-x64     • Mac OS X
      10.15.4 19E266
    • Chrome        • chrome                    • web-javascript • Google Chrome
      80.0.3987.149
    • Web Server    • web-server                • web-javascript • Flutter Tools

• No issues found!

iOS Framework automation moved this from Easy fix to Done Mar 28, 2020
Mobile - iOS fidelity review automation moved this from Awaiting Triage to Engineer Reviewed Mar 28, 2020
@lock
Copy link

lock bot commented Apr 15, 2020

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 -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better f: cupertino flutter/packages/flutter/cupertino repository f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-ios iOS applications specifically
Projects
Mobile - iOS fidelity review
  
Engineer Reviewed
iOS Framework
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants