Skip to content

Floating action buttons don't respect SafeArea #58942

@mehmetf

Description

@mehmetf

b/158392371

When using a Scaffold, floatingActionButton: doesn't seem to respect the bottom SafeArea.

Full repro code:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
        appBar: AppBar(title: Text('FloatingActionButton test')),
        body: SafeArea(
          child: Container(color: Colors.yellow),
        ),
        floatingActionButton: RaisedButton(
          onPressed: () {},
          child: Text('Press me'),
        ),
      ),
    );
  }
}

Result:
image

The yellow area is the safe area, but it can clearly be seen that the RaisedButton goes into the safe area.

Wrapping the RaisedButton with a SafeArea widget doesn't change its position either.

Similar issue: #30105

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressioncustomer: money (g3)f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions