Skip to content

Document that WillPopScope prevents swipe to go back on MaterialPageRoute #14203

@dudeofawesome

Description

@dudeofawesome

Steps to Reproduce

  1. Add a MaterialPageRoute to your app's page stack
    return new MaterialPageRoute<Null>(
      settings: settings,
      builder: (BuildContext context) => new StoryPage(itemId: itemId),
    );
  2. Wrap that page's Scaffold in a WillPopScope widget
    return new WillPopScope(
      onWillPop: () async {
        return true;
      },
      child: new Scaffold(
        …
      ),
    );
  3. Try to swipe to go back on iOS. The page won't swipe.

This also occurs if you replace the MaterialPageRoute with a CupertinoPageRoute.

I think this might be an unintended side-affect of fixing #8269.

For a live example of this, see my repo here.

Flutter Doctor

[✓] Flutter (on Mac OS X 10.13.2 17C205, locale en-US, channel master)
    • Flutter version 0.0.21-pre.284 at /Users/DudeOfAwesome/Library/Developer/flutter
    • Framework revision 7cdfe6fa0e (2 days ago), 2018-01-20 00:36:00 -0800
    • Engine revision e45eb692b1
    • Tools Dart version 2.0.0-dev.16.0
    • Engine Dart version 2.0.0-edge.93d8c9fe2a2c22dc95ec85866af108cfab71ad06

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/DudeOfAwesome/Library/Android/sdk
    • Android NDK at /Users/DudeOfAwesome/Library/Android/sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/DudeOfAwesome/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.3.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2.5)
    • Flutter plugin version 18.1
    • Dart plugin version 172.4343.25

[✓] Connected devices
    • iPhone X • C927CB75-4D41-426B-9B32-D859B2FC5FFD • ios • iOS 11.2 (simulator)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.customer: mulligan (g3)d: api docsIssues with https://api.flutter.dev/d: examplesSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions