Skip to content

Scaffold body is hidden behind bottomSheet #50314

Open

Description

@yringler

Steps to Reproduce

  1. Clone https://github.com/yringler/reproduce-bottom-sheet
  2. Run it

Expected results:
The body should be scroll-able to see all content.

Actual results:
Part of the body content is cut off, and it can't be scrolled to

Activity

  1. yringler commented on Feb 7, 2020

    @yringler
    ContributorAuthor

    I'm trying to add media controls along the bottom of app, across all app routes. Using bottom sheet worked great, until I noticed that it was covering the body.
    Is that intended behavior? Is that documented somewhere? How is bottom sheet intended to be used? Is there a way to dynamically size body according to available space?

  2. yringler commented on Feb 7, 2020

    @yringler
    ContributorAuthor

    BTW, ❤️ flutter. It was actually kinda fun making that reproduction case, and took like 3 minutes.
    Note the usage of MediaQuery to make sure that the unexpected behavior always occurs, regardless of device size. 😌

  3. VladyslavBondarenko commented on Feb 7, 2020

    @VladyslavBondarenko

    Hi @yringler
    As workaround you can set bottom padding to the body with the same value that you set to the bottomSheet height

    body: Padding(
            padding: EdgeInsets.only(bottom: MediaQuery.of(context).size.height / 7),
            child: Center(...),
    )
    
  4. added
    d: api docsIssues with https://api.flutter.dev/
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Feb 7, 2020
  5. yringler commented on Feb 7, 2020

    @yringler
    ContributorAuthor

    Thank you.
    It's a little more tricky for actual app because the bottom sheet isn't always showing (only when audio is playing), but a little streambuilder (abstracted to it's own widget) has everything working great.
    (here's the widget which gives child padding if audo bar is visible, and widget which tells child if audio bar is visible)

  6. darshankawar commented on Jul 9, 2020

    @darshankawar
    Member

    Hi @yringler,
    Can you please confirm if this is still an issue on latest Flutter channel (eg : dev, master) ?

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 9, 2020
  8. yringler commented on Jul 9, 2020

    @yringler
    ContributorAuthor

    Yep, switched to flutter channel master, ran flutter upgrade, flutter clean, and ran it again, still an issue.
    Here's the output of flutter doctor:

    octor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel master, 1.20.0-3.0.pre.193, on Linux, locale en_US.UTF-8)
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        ✗ Android license status unknown.
          Try re-installing or updating your Android SDK Manager.
          See https://developer.android.com/studio/#downloads or visit
          https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions.
    [✓] Android Studio (version 4.0)
    [✓] VS Code (version 1.46.1)
    [✓] Connected device (2 available)
    
    ! Doctor found issues in 1 category.
    
  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 9, 2020
  10. zepfietje commented on Dec 2, 2020

    @zepfietje

    I can confirm this issue still occurs in Flutter 1.22.4.

    Can anyone confirm this really is a bug and not expected behavior?
    Since any widget can be passed as bottomSheet to Scaffold (to be shown permanently), I do feel like it is a bug that body content gets covered by the persistent bottomSheet widget.

  11. darshankawar commented on Dec 3, 2020

    @darshankawar
    Member

    Verified and replicable on latest stable. Content beyond 5 is hidden behind bottomsheet which isn't scrollable.

    Screenshot 2020-12-03 at 11 10 26 AM

    flutter doctor -v
    [✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.4 19E2269 darwin-x64,
        locale en-IN)
        • Flutter version 1.22.4 at /Users/dhs/documents/Fluttersdk/flutter
        • Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
        • Engine revision 2c956a31c0
        • Dart version 2.10.4
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
        • Android SDK at /Users/dhs/Library/Android/sdk
        • Platform android-30, build-tools 30.0.0
        • 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 12.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.0.1, Build version 12A7300
        • CocoaPods version 1.9.3
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 46.0.2
        • Dart plugin version 193.7361
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.51.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.16.0
    
    [✓] Connected device (1 available)
        • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11
          (API 30) (emulator)
    
    • No issues found!
    
    
  12. 27 remaining items

  13. vipranarayan14 commented on Jun 20, 2023

    @vipranarayan14

    Facing the same issue in 3.10.2. As a workaround, I moved the bottomsheet widget inside the scaffold body and pushed it to the bottom of the page using the Column and Expanded widgets. This way I don't have to worry about the bottomsheet widget's height.

    Scaffold(
      appBar: AppBar(
        title: const Text('Appbar'),
      ),
      // bottomSheet: Container(child: Text("Bottom Sheet")),
      body: Column(
        children: [
          Expanded(
            child: ListView(
              children: List.generate(50, (index) => index + 1)
                  .map((item) => Text("Item $item"))
                  .toList(),
            ),
          ),
          Container(child: const Text("Bottom Sheet")),
        ],
      ),
    );
  14. innomatica commented on Jul 11, 2023

    @innomatica

    As pointed out by @CevinWays, I use bottomNavigationBar instead of bottomSheet to solve this issue. I do not know if it has any side effect though.

    Instead of

    return Scaffold(
        ...
        bottomSheet: buildBottomSheet(),
        bottomNavigationBar: bulidBottomNavigationBar(),
    );
    

    use

    return Scaffold(
        ...
        bottomNavigationBar: Column(
            mainAxisSize: MainAxisSize.min,    // this is necessary
            children: [ 
                buildBottomSheet(),
                bulidBottomNavigationBar(),
            ],
        ),
    );
    
  15. egormzln commented on Aug 17, 2023

    @egormzln

    Flutter 3.10.6 the same issue

  16. thecoder-co commented on Jan 21, 2024

    @thecoder-co

    Flutter 3.13.6 has the same issue

  17. yasht01 commented on Feb 13, 2024

    @yasht01

    Is there any good workaround for this issue? Facing it on 3.13.9 and 3.16.8

  18. added
    P2Important issues not at the top of the work list
    workaround availableThere is a workaround available to overcome the issue
    on Feb 14, 2025
  19. ViniciusCdeAlmeida commented on Aug 12, 2025

    @ViniciusCdeAlmeida

    Is there any good workaround for this issue? Facing it on 3.13.9 and 3.16.8

    #50314 (comment)

  20. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 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 listfound in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions