Open wangmir opened 1 year ago
And, also, when folding the phone, the maxHeight also was changed to the half of the height of screen only for dialog.
I can reproduce the issue using a 6.7" Horizontal Fold-in
emulator. I tested a similar code sample in jetpack compose, but the dialog's position didn't change no matter the state the emulator was in.
Seems like a bug, labeling for further investigation.
jetpack compose | flutter |
---|---|
The fyi-framework
label is redundant with the team-framework
label.
In Fold phone alert dialog remains in left side after Unfloadig the phone
It seems showDialog or AlertDialog (I'm not sure what is the real problem.) acts wrongly at flex mode (folded) of Samsung ZFlip4 & 3. There are no spec about flex mode, but when folding the phone, only the position of the dialog was change to the center of upper part of the screen.
I think, it's wrong behavior because showDialog or AlertDialog has no spec on that, and the rest of view remains same. I think, there should not be partial changes (like only dialog position changing) until supporting flex mode explicitly, so I think it seems a buggy situation.
How can we solve this? At least, can I disable flex mode for the view from flutter side?
Steps to Reproduce
flutter create
except calling showDialog)showDialog
Code sample
```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or simply save your changes to "hot reload" in a Flutter IDE). // Notice that the counter didn't reset back to zero; the application // is not restarted. primarySwatch: Colors.blue, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); // This widget is the home page of your application. It is stateful, meaning // that it has a State object (defined below) that contains fields that affect // how it looks. // This class is the configuration for the state. It holds the values (in this // case the title) provided by the parent (in this case the App widget) and // used by the build method of the State. Fields in a Widget subclass are // always marked "final". final String title; @override State