Skip to content

AppBar shows Back Button when EndDrawer is open #13601

Closed

Description

@brianegan

Steps to Reproduce

  1. Add an appBar with a title and endDrawer to a Scaffold in a LTR language (English in my case).
  2. Observe the AppBar. No back button.
  3. Open the endDrawer
  4. Observe the AppBar. Back Button appears.

Not an end of the world bug by any means, but overall it looks a bit weird / causes a visual flash in the UI as the Drawer animates in smoothly and then the back button pops in all of a sudden. In addition, it can't be tapped because it's underneath the Drawer layer, so it appears to lack functional value for being there.

Might make sense to simply not show the back button in response to a Drawer being opened? Not sure what other ramifications that would have...

Thanks for your time :)

Screenshot

screenshot_1513334416

Flutter Doctor

[✓] Flutter (on Mac OS X 10.13.2 17C88, locale en-US, channel alpha)
    • Flutter at /Users/phillywiggins/lab/flutter
    • Framework revision 8f65fec5f5 (3 days ago), 2017-12-12 09:50:14 -0800
    • Engine revision edaecdc8b8
    • Tools Dart version 1.25.0-dev.11.0
    • Engine Dart version 2.0.0-edge.d8ae797298c3a6cf8dc9f4558707bd2672224d3e

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /Users/phillywiggins/Library/Android/sdk
    • Android NDK at /Users/phillywiggins/Library/Android/sdk/ndk-bundle
    • Platform android-26, build-tools 26.0.2
    • ANDROID_HOME = /Users/phillywiggins/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 Community Edition (version 2017.3.1)
    • Flutter plugin version 20.0.3
    • Dart plugin version 173.3942.31

[✓] Connected devices
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)

Activity

  1. Hixie commented on Dec 15, 2017

    @Hixie
    Contributor

    Hah, that's funny. The back button is appearing because you can now go back (to close the drawer!).

    We should have the back button be more aware of where it sits on the history stack so that it ignores routes put on top of it (I bet the same thing happens if you show a dialog).

  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Dec 16, 2017
  3. added
    f: routesNavigator, Router, and related APIs.
    on Mar 8, 2018
  4. alamyudi commented on Aug 23, 2018

    @alamyudi

    i'm also have same experience, but it's done by setting up automaticallyImplyLeading to false in AppBar.

    simulator screen shot - iphone 6 - 2018-08-23 at 15 58 40

  5. added this to the milestone on Jan 31, 2019
  6. added
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Mar 25, 2020
  7. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  8. VladyslavBondarenko commented on Jul 31, 2020

    @VladyslavBondarenko

    Persists with current master 1.21.0-6.0.pre.129

    Back Button is shown when Drawer is open (isn't shown when dialog is open).

    code sample
    import 'package:flutter/material.dart';
    
    void main() => runApp(MaterialApp(home: MyApp()));
    
    class MyApp extends StatefulWidget {
      @override
      _MyAppState createState() => _MyAppState();
    }
    
    class _MyAppState extends State<MyApp> {
      @override
      Widget build(BuildContext context) {
        return SafeArea(
          child: Scaffold(
            appBar: AppBar(
              title: Text('title'),
            ),
            endDrawer: Drawer(
              child: Center(child: Text('drawer')),
            ),
            body: Center(
              child: RaisedButton(
                child: Text('show dialog'),
                onPressed: () {
                  showDialog(
                      context: context,
                      builder: (BuildContext context){
                        return AlertDialog(
                          title: Text("Alert Dialog"),
                          content: Text("Dialog Content"),
                        );
                      }
                  );
                },
              ),
            ),
          ),
        );
      }
    }
    
    flutter doctor -v
    [✓] Flutter (Channel master, 1.21.0-6.0.pre.129, on Mac OS X 10.15.6 19G73, locale en-GB)
        • Flutter version 1.21.0-6.0.pre.129 at /Users/nevercode/dev/flutter
        • Framework revision 30aef0a3b9 (14 hours ago), 2020-07-30 14:20:21 -0700
        • Engine revision a9910e409c
        • Dart version 2.10.0 (build 2.10.0-1.0.dev 24c7666def)
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        • Android SDK at /Users/nevercode/Library/Android/sdk
        • Platform android-29, build-tools 29.0.3
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 11.6)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.6, Build version 11E708
        • CocoaPods version 1.9.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 47.1.2
        • Dart plugin version 193.7361
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.47.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.12.2
    
    [✓] Connected device (6 available)
        • Redmi Note 7 (mobile)       • 6345c469                                 • android-arm64  • Android 9 (API 28)
        • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 13.6
        • iPhone 11 Pro Max (mobile)  • 55C8466B-5367-492B-8EFE-EC45D980571F     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
        • macOS (desktop)             • macos                                    • darwin-x64     • Mac OS X 10.15.6 19G73
        • Web Server (web)            • web-server                               • web-javascript • Flutter Tools
        • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 84.0.4147.105
    
    • No issues found!
    
  9. removed this from the milestone on Aug 17, 2020
  10. thecalamiity commented on Sep 23, 2020

    @thecalamiity
    Contributor

    @Hixie PR fixing this issue was merged. I think we can close this

  11. pedromassango commented on Sep 24, 2020

    @pedromassango
    Member

    Fixed by #63272

  12. pedromassangocode commented on Sep 25, 2020

    @pedromassangocode

    Closing as fixed by #63272

  13. tushardabhi1410 commented on Feb 5, 2021

    @tushardabhi1410

    Simple Way to fix that problem
    -> Add Appbar Following Code

    automaticallyImplyLeading: false,

    Solve Your Problems

  14. github-actions commented on Aug 6, 2021

    @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.

  15. locked as resolved and limited conversation to collaborators on Aug 6, 2021
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 listcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.f: routesNavigator, Router, and related APIs.found in release: 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions