Repository navigation
Open
Labels
P2Important issues not at the top of the work lista: qualityA truly polished experiencea: tabletTablets and landscape phonesfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has 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 team
Description
Steps to reproduce
- use
showModalBottomSheet()in a callback - wrap the returned
WidgetwithSafeArea() - deploy on Android
- rotate device into landscape orientation
Expected results
The bottom sheet should have a width roughly the same as the widget it contains.
Actual results
The bottom sheet has excessive margin on its left side. This was not the case on Linux or Web. I only observed the extra margin on Android in landscape orientation.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() async {
runApp(MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: const Home(),
);
}
}
class Home extends StatelessWidget {
const Home({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton(
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
return const SafeArea(
minimum: EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [Text('Foo'), Text('Bar')],
),
);
},
);
},
child: Text('Show bottom sheet'),
),
),
);
}
}Screenshots or Video
Logs
N/A
Flutter Doctor output
Doctor output
$ fvm flutter doctor -v
[✓] Flutter (Channel stable, 3.35.3, on Debian GNU/Linux forky/sid 5.15.133.1-microsoft-standard-WSL2, locale en_US.UTF-8) [37ms]
• Flutter version 3.35.3 on channel stable at /home/jpwoodbu/fvm/versions/3.35.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a402d9a437 (12 days ago), 2025-09-03 14:54:31 -0700
• Engine revision ddf47dd3ff
• Dart version 3.9.2
• Java binary at: /home/jpwoodbu/Android/android-studio.new/jbr/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Chrome - develop for the web [11ms]
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop [356ms]
• Debian clang version 19.1.7 (3+b2)
• cmake version 3.31.6
• ninja version 1.12.1
• pkg-config version 1.8.1
! Unable to access driver information using 'eglinfo'.
It is likely available from your distribution (e.g.: apt install mesa-utils)
[✓] Android Studio (version 2023.3) [8ms]
• Android Studio at /home/jpwoodbu/Android/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
[✓] Android Studio (version 2024.3) [7ms]
• Android Studio at /home/jpwoodbu/Android/android-studio.new
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
[✓] Connected device (3 available) [620ms]
• Pixel 8a (mobile) • 192.168.86.67:39551 • android-arm64 • Android 16 (API 36)
• Linux (desktop) • linux • linux-x64 • Debian GNU/Linux forky/sid 5.15.133.1-microsoft-standard-WSL2
• Chrome (web) • chrome • web-javascript • Google Chrome 140.0.7339.127
[✓] Network resources [115ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work lista: qualityA truly polished experiencea: tabletTablets and landscape phonesfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has 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 team


Activity
tirth-patel-nc commentedon Sep 16, 2025
@jpwoodbu thanks for the report. I wasn’t able to reproduce this on either an emulator or a real device (Pixel 6a) in landscape mode using the provided code sample on the latest stable (3.35.3) or the latest master (3.37.0-1.0.pre-132). could you check if the issue still occurs on the latest master? also, is this specific to your device (Pixel 8a), or do you see it elsewhere as well?
jpwoodbu commentedon Sep 16, 2025
Thanks for the quick triage! I am able to reproduce this with Flutter 3.37.0-1.0.pre-134 on my physical Pixel 8a and in the emulator using the Pixel 8a profile. The "Medium Phone API 36.0" emulator profile does not reproduce the issue.
Here's a screenshot with the emulator running the Pixel 8a profile running an APK built with Flutter 3.37.0-1.0.pre-134.
jpwoodbu commentedon Sep 16, 2025
Oh, to answer your question more directly, I also tried the demo code above on Linux and the issue was not present even with a wide window. I have not tried it on iOS or web. I've only seen the issue on my physical Pixel 8a and the emulated Pixel 8a.
jpwoodbu commentedon Sep 17, 2025
I came across some potential clues. The issue is not present in the Pixel 8a emulator if 3-button navigation is enabled.
If there is no on-screen camera, like in this Pixel 4 emulator, the issue is not present.
tirth-patel-nc commentedon Sep 17, 2025
Thanks for the report. Seeing the same behaviour with latest SDK versions with Gesture Navigation (i.e. disabling 3 button navigation). useSafeArea didn't work either. #69676 might be related
[-]showModalBottomSheet with SafeArea has extra left margin on Android in landscape[/-][+]showModalBottomSheet with SafeArea has extra left/right margin on Android in landscape[/+]tirth-patel-nc commentedon Sep 29, 2025
extra margin (left/right) depends on the landscape orientation. updating the title. Tested on Physical Pixel 6a/9a.
Screen.Recording.2025-09-29.at.1.03.21.PM.mov
cc: @huycozy