Skip to content

Floating action button location is wrong for top locations when using Scaffold property 'extendBodyBehindAppBar' #63915

@rydmike

Description

@rydmike

Issue Summary

If you use the Scaffold property extendBodyBehindAppBar and use any of the Floating action button locations:

FloatingActionButtonLocation.startTop
FloatingActionButtonLocation.centerTop
FloatingActionButtonLocation.endTop

The FAB location is wrong based on how the location is specified in the documentation. All the top locations are described as "floating over the transition between the Scaffold.appBar and the Scaffold.body."

https://api.flutter.dev/flutter/material/FloatingActionButtonLocation-class.html

If you use extendBodyBehindAppBar the FAB moves up and becomes centered vertically in the app bar.

Steps to Reproduce

The issue applies to all Flutter channels and any target type and can easily be demonstrated with a DartPad example:

https://dartpad.dartlang.org/4fb5f2d1316115913fc41a26463486e6

Source: https://gist.github.com/rydmike/4fb5f2d1316115913fc41a26463486e6

Expected results

When extendBodyBehindAppBar is false the top FAB locations are correct:

image

Actual results

When extendBodyBehindAppBar is true the top FAB locations are incorrect:

image

Additional info

With the issue demo application we can turn of the properties extendBodyBehindAppBar and extendBody and try different FloatingActionButtonLocation. The example app also uses semi-transparent app- and bottom navigation bars so we can verify and see content scrolling behind them when the properties are enabled.

With the issue demo application we can also test and verify that this faulty location behavior is not replicated on bottom locations when using any of the FAB bottom locations combined with the Scaffold extendBody property, nor does the presence of the app bar or bottom navigation bar affect the results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer: housecustomer: web10f: material designflutter/packages/flutter/material repository.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 onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions