Content-Length: 322691 | pFad | https://github.com/flutter/flutter/issues/171448

E0 Strange dialog behavior on foldable devices in half-fold mode · Issue #171448 · flutter/flutter · GitHub
Skip to content

Strange dialog behavior on foldable devices in half-fold mode #171448

@math1man

Description

@math1man

Steps to reproduce

  1. Open up a standard dialog or bottomsheet using showDialog() or showModalBottomSheet().
  2. Partially fold device so that it is in "half-fold" mode.
  3. Try both horizontal and vertical orientations of half-fold mode.

Expected results

Modal should stay in the same position as it is in the unfolded state. I still need to work with our UX team to determine the exact preferred behavior here, but at a minimum there should be a way to turn this behavior on or off.

Actual results

Modal position is changed based on the position and orientation of the fold.

Code sample

Code sample
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: true),
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      floatingActionButton: FloatingActionButton(
        onPressed:
            () => showModalBottomSheet(
              context: context,
              builder:
                  (context) => Padding(
                    padding: const EdgeInsets.all(24),
                    child: Text('Bottom sheet'),
                  ),
            ),
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Fully unfolded with a vertical fold orientation:

Image

Half-folded with a vertical fold orientation:

Image

Fully unfolded with a horizontal fold orientation:

Image

Half-folded with a horizontal fold orientation:

Image

Logs

Logs: N/A

Flutter Doctor output

Doctor output
[✓] Flutter (Channel REDACTED, on Debian GNU/Linux REDACTED, locale en_US.UTF-8) [1ms]
    • Framework revision 75a77fec8c (13 days ago), 2025-06-18T00:00:00.000
    • Engine revision 75a77fec8c
    • Dart version b32559bca3

[✓] Android toolchain - develop for Android devices (Android SDK version Stable) [119ms]
    • Android SDK at REDACTED
    • Emulator version unknown
    • Platform Stable, build-tools Stable
    • Java binary at: REDACTED
      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.6+-13368085-b895.109)

[!] Flutter IDE Support (No supported IDEs installed) [116ms]
    • IntelliJ - https://www.jetbrains.com/idea/
    • Android Studio - https://developer.android.com/studio/
    • VS Code - https://code.visualstudio.com/

[✓] Connected device (2 available) [217ms]
    • Pixel Fold (mobile) • REDACTED • android-arm64 • Android 16 (API 36)
    • Linux (desktop)     • linux          • linux-x64     • Debian GNU/Linux REDACTED

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/171448

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy