Skip to content

Tapping outside of drawer twice to dismiss it breaks swipe to go back #133740

Closed
flutter/packages
#12552

Description

@pavlyhabashy

Is there an existing issue for this?

Steps to reproduce

  1. In a child Scaffold, add a right drawer and open it.
  2. Tap twice outside the drawer to dismiss it.
  3. Attempt iOS swipe to go back (doesn't work).

Expected results

Swipe to go back should still work after dismissing the drawer given any number of dismiss requests.

Actual results

Swipe to go back doesn't work.

Code sample

Code sample
class AppDrawer extends ConsumerWidget {
  final Service currService;
  final Hour currHour;
  final void Function(int hourIdx, int index) jumpToWidget;
  final void Function() closeDrawer;
  final bool drawerBackButton;
  const AppDrawer({
    required this.currService,
    required this.currHour,
    required this.jumpToWidget,
    required this.closeDrawer,
    this.drawerBackButton = false,
  });

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    var state = ref.read(contentViewBuildStateProvider);
    final startIdx = state.startIdx;
    return ClipRRect(
      borderRadius: BorderRadius.horizontal(left: Radius.circular(15)),
      child: Drawer(
        width: useMobileLayout
            ? Theme.of(context).drawerTheme.width
            : MediaQuery.of(context).size.width / 3,
        child: SafeArea(
          child: Column(

Screenshots or Video

RPReplay_Final1693465907.mp4

Logs

No response

Flutter Doctor output

Doctor output
Flutter 3.13.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ff5b5b5fa6 (7 days ago) • 2023-08-24 08:12:28 -0500
Engine • revision b20183e040
Tools • Dart 3.1.0 • DevTools 2.25.0

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.2, on macOS 13.5.1 22G90 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2022.3)
[!] Android Studio (version unknown)
    ✗ Unable to determine Android Studio version.
[✓] VS Code (version 1.81.1)
[✓] Connected device (1 available)
    ! Error: (null) needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and unlocked. (code 1)
[✓] Network resources```

</details>

Activity

  1. dam-ease commented on Aug 31, 2023

    @dam-ease

    Hi @pavlyhabashy. Thanks for filing this issue. I can't seem to reproduce this on my end using the code sample below.

    Code Sample

    import 'package:flutter/material.dart';
    
    void main() {
      runApp(const MyApp());
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      // This widget is the root of your application.
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
            useMaterial3: true,
          ),
          home: const MyHomePage(title: 'Flutter Demo Home Page'),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      const MyHomePage({super.key, required this.title});
      final String title;
    
      @override
      State<MyHomePage> createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          drawerEnableOpenDragGesture: true,
          appBar: AppBar(
            backgroundColor: Theme.of(context).colorScheme.inversePrimary,
            title: Text(widget.title),
          ),
          body: const Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                TextField(),
                TextField(),
              ],
            ),
          ),
          drawer: Drawer(),
        );
      }
    }

    Video

    untitled.webm

    Can you provide more info on this? You could also edit the code sample above to suit your reproduction case.

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 31, 2023
  3. pavlyhabashy commented on Sep 1, 2023

    @pavlyhabashy
    Author

    I was able to recreate with this code

    Code sample
    class MyHomePage extends StatelessWidget {
      const MyHomePage({super.key, required this.title});
    
      final String title;
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            backgroundColor: Theme.of(context).colorScheme.inversePrimary,
            title: Text(title),
          ),
          endDrawer: const Drawer(),
          endDrawerEnableOpenDragGesture: true,
          drawerEdgeDragWidth: MediaQuery.of(context).size.width,
          body: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                TextButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                        builder: (context) => const MyHomePage(title: 'Second'),
                      ),
                    );
                  },
                  child: const Text("Go"),
                ),
              ],
            ),
          ),
        );
      }
    }

    Output:

    RPReplay_Final1693537290.MP4
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 1, 2023
  5. dam-ease commented on Sep 1, 2023

    @dam-ease

    Hi @pavlyhabashy. Thanks for your response. I see you are reproducing on iOS this time. I tried reproducing both on Android and iOS but still can't seem to reproduce, are there any steps I might be missing out on?

    iOS Android
    Simulator.Screen.Recording.-.iPhone.14.-.2023-09-01.at.09.19.25.mp4
    untitled.webm
  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 1, 2023
  7. pavlyhabashy commented on Sep 5, 2023

    @pavlyhabashy
    Author
    IMG_0508.mp4
  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 5, 2023
  9. dam-ease commented on Sep 5, 2023

    @dam-ease

    Thanks for the video, can you share the device information you are reproducing this on so I could check with it as well.

  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 5, 2023
  11. pavlyhabashy commented on Sep 5, 2023

    @pavlyhabashy
    Author

    iPhone 13 Pro on iOS 16. However, this bug is in one of our released apps on the App Store so we know it's happening on other devices including iPads as we've gotten complaints about it.

  12. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 5, 2023
  13. dam-ease commented on Sep 5, 2023

    @dam-ease

    Thanks for your patience @pavlyhabashy. I am able to reproduce this on a physical device (iPhone 13, iOS 16.6), but this issue doesn't reproduce on a simulator/emulator. Following the reproduction steps, I observed that sometimes after attempting the swipe to go back action a number of times, it works (as shown in the video below).

    RPReplay_Final1693921668.MP4
    stable, master flutter doctor -v

    [✓] Flutter (Channel stable, 3.13.2, on macOS 13.0 22A380 darwin-arm64, locale
        en-NG)
        • Flutter version 3.13.2 on channel stable at
          /Users/damilolaalimi/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ff5b5b5fa6 (12 days ago), 2023-08-24 08:12:28 -0500
        • Engine revision b20183e040
        • Dart version 3.1.0
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/damilolaalimi/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14E300c
        • CocoaPods version 1.12.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.81.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (4 available)
        • iPhone 13 Pro (mobile) • 14B6FEE4-2F1C-401F-8804-A5115D7A6DA2 • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • iPhone 14 (mobile)     • EDD62579-BA84-4339-BDA7-E870040C507A • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • macOS (desktop)        • macos                                •
          darwin-arm64   • macOS 13.0 22A380 darwin-arm64
        • Chrome (web)           • chrome                               •
          web-javascript • Google Chrome 116.0.5845.140
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    
    [✓] Flutter (Channel stable, 3.13.2, on macOS 13.0 22A380 darwin-arm64, locale
        en-NG)
        • Flutter version 3.13.2 on channel stable at
          /Users/damilolaalimi/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ff5b5b5fa6 (12 days ago), 2023-08-24 08:12:28 -0500
        • Engine revision b20183e040
        • Dart version 3.1.0
        • DevTools version 2.25.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/damilolaalimi/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14E300c
        • CocoaPods version 1.12.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2022.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build
          17.0.6+0-17.0.6b802.4-9586694)
    
    [✓] VS Code (version 1.81.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (4 available)
        • iPhone 13 Pro (mobile) • 14B6FEE4-2F1C-401F-8804-A5115D7A6DA2 • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • iPhone 14 (mobile)     • EDD62579-BA84-4339-BDA7-E870040C507A • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
        • macOS (desktop)        • macos                                •
          darwin-arm64   • macOS 13.0 22A380 darwin-arm64
        • Chrome (web)           • chrome                               •
          web-javascript • Google Chrome 116.0.5845.140
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    

  14. changed the title [-]Tapping outside of Android drawer twice to dismiss it breaks swipe to go back[/-] [+]Tapping outside of drawer twice to dismiss it breaks swipe to go back[/+] on Sep 5, 2023
  15. 10 remaining items

  16. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Jan 31, 2024
  17. flutter-triage-bot commented on Jan 31, 2024

    @flutter-triage-bot

    This issue is assigned to @Hangyujin but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  18. flutter-triage-bot commented on Apr 9, 2024

    @flutter-triage-bot

    This issue was assigned to @Hangyujin but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  19. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Apr 9, 2024
  20. HansMuller commented on Apr 10, 2024

    @HansMuller
    Contributor
  21. github-actions commented on Oct 6, 2026

    @github-actions

    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.

  22. locked as resolved and limited conversation to collaborators on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: gesturesflutter/packages/flutter/gestures repository.found in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions