Skip to content

Persistent bottom sheet does not respect SafeArea #69676

@amitkot

Description

@amitkot

When showing a persistent bottom sheet SafeArea is ignored and does not provide bottom padding:

Screen Shot 2020-11-03 at 16 18 04

Code:

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(home: MyHomePage());
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) => Scaffold(
        floatingActionButton: Builder(
          builder: (context) => FloatingActionButton(
            onPressed: () {
              showBottomSheet(
                  context: context,
                  builder: (context) => SafeArea(
                        child: Container(
                          height: 100,
                          width: 200,
                          color: Colors.red,
                        ),
                      ));
            },
          ),
        ),
      );
}
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.14.6 18G6032, locale en-IL)
    • Flutter version 1.22.2 at /Users/amit/fvm/versions/stable
    • Framework revision 84f3d28555 (3 weeks ago), 2020-10-15 16:26:19 -0700
    • Engine revision b8752bbfff
    • Dart version 2.10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22found in release: 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: 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