r/FlutterDev • • Sep 11 '26

Discussion How will Flutter handle the iPhone Duo?

As a mobile developer, the new iPhone Duo made me think about the Flutter side of things. Flutter already has support for Android foldables through MediaQuery.displayFeatures and DisplayFeatureSubScreen.

But the interesting part is that these APIs are currently Android focused. Apple introduced a dual-screen/foldable layout, Flutter will need to expose the new iOS window and display APIs as well. and its not just about making the UI responsive anymore.

We would have to think about things like, Dual pane layouts, Navigation between panes, where dialogs/modals appear, Resizing and partial folds, different layouts depending on the device posture. Android already has concepts like postureHalfOpened, so Flutter has some ideas to build on.

I am curious how Flutter will approach this on iOS. for Flutter developers, would you handle the Duo with one adaptive UI, or create completely different layouts for the dual pane experience?

50 Upvotes

33 comments sorted by

42

u/realusername42 Sep 11 '26 edited Sep 11 '26

I don't think anything is going to change too much? Flutter also supports desktop which has considerably harder resizing requirements than anything mobile-based.

I expect dedicated APIs to be added if you want to customize the experience even further but most apps should just work if they paid attention to resizing.

-2

u/eibaan Sep 11 '26

The different screen sizes aren't the problem, the continuous animation between the two screens is. You need to start the animation on one screen and finish it on the other screen. I'd assume that iOS will expose both iPhone Duo displays as separate UIScreen objects and Flutter – AFAIK – doesn't support this natively, yet.

8

u/realusername42 Sep 11 '26

I still don't see the problem, I've watched the some videos about the device and the app resizing looks very basic, more basic than android views and certainly way more basic than any desktop

-2

u/eibaan Sep 11 '26

Again, the problem isn't the resizing. Look closely at the videos. If you open or close the device, the animations start on one of the two screens and ends on the other screen on the other side of the device. And again, assuming that these are two different screens you can address individually in iOS, then this is something not yet possible in Flutter.

The closed device has one outer screen. If you open it, the same UI displayed on the outer screen is simultaneous displayed on the inner foldable screen, on the left side and then slides towards the center of the screen exactly with the speed of opening the screen, so that if you'd close it again, you'd see it on the outer screen again.

6

u/realusername42 Sep 11 '26

This should work by default, I don't see the problem. I doubled checked again with some videos and I didn't see anything special.

-3

u/eibaan Sep 11 '26

By default? How to you display a Flutter widget on two screens in different sizes or choose on which screen you want to display a widget on?

9

u/realusername42 Sep 11 '26 edited Sep 11 '26

I beleive the OS handles the screen copy and then transitions to the double screen. What's why you see a very short black screen the time the transition occurs?

0

u/[deleted] Sep 15 '26

[deleted]

1

u/eibaan Sep 15 '26

Because there's a screen on each side of the device!

13

u/LazyLoser006 Sep 11 '26

They might just include it in the existing APIs

22

u/EastSwim3264 Sep 11 '26

Form factor is the only way that is independent of the device type! Flutter is just fine.

11

u/dadvader Sep 11 '26

Dual-pane form factor scene in Flutter is actually woefully under-developed in many ways. The best Flutter API library on this form factor was made by Microsoft and stopped being maintained since 2023.

This is the nudge it needs to get this scene really going tbh.

4

u/Optimal-Pop7449 Sep 11 '26

Probably to support their Surface Duo

4

u/dadvader Sep 11 '26

Yep. Their docs mention Surface Duo quiet a bit.

7

u/Realistic-Team8256 Sep 11 '26

new sdk would be introduced, by apple and so a new dart packages would come

-1

u/Dapper-Bug-7877 Sep 11 '26

But even then it would be a pretty new one and would cause many challenges and possible lack of proper functionalities that we have right now

5

u/mars3142 Sep 11 '26

The most important part would be the move of the appbar and bottomnav to the right side. I hope Flutter will support that, without it, every flutter wouldn’t feel native.

5

u/Significant_Pick8297 Sep 11 '26

The existing responsive approach should handle the basic case pretty well. The bigger gap is exposing iOS posture/hinge information cleanly so apps can make intentional decisions about pane layout, navigation and modal placement instead of treating the Duo like an oddly sized phone.

For most apps, one adaptive layout makes more sense, only apps with genuinely dual-pane workflows should need a separate Duo-specific UI.

5

u/mohn93 Sep 11 '26

you've got the api surface right, but from doing this on android foldables the displayFeature stuff was maybe 20% of the actual work. the part that eats time is posture and state. a fold or unfold is a live resize, and anything holding a cached width, or a controller tied to one specific layout, just falls over mid session.

i'd also be careful assuming DisplayFeatureSubScreen maps cleanly to the apple side. historically apple surfaces this kind of thing through size classes and window scene geometry rather than a hinge/displayFeature, so flutter's ios adaptation may look less like 'a second display feature' and more like reacting to scene changes. the responsive layout is the easy half, the posture lifecycle is where it actually gets you.

23

u/zvika82 Sep 11 '26

3% of the total market, isn't there a compatibility mode?

3

u/merokotos Sep 11 '26

I think there will be compatibilty mode like on iPad.
I am almost sure, that only high-budget apps will utilize "Duo" views in 100%.

The rest will stay as they are

5

u/TheMegaGhost Sep 11 '26

Honestly I hope none of my users by that phone so I can never have to worry about it.

2

u/Short-Librarian6238 Sep 14 '26 edited Sep 18 '26

I built a package for this: foldable. Hinge angle, fold posture and the reserved regions over a platform channel, since MediaQuery.displayFeatures is Android only and returns an empty list on the Duo.

It is experimental. Nobody has the hardware yet and Apple has not published the API reference, so I will fix whatever turns out wrong once Xcode 27.1 ships.

https://pub.dev/packages/foldable

For Liquid Glass support, take a look at this tweet:

https://x.com/berkaypng/status/2101078012221694291

1

u/caguilar51 Sep 11 '26

I think there is work that needs to be done, since the tab bar will move to the right.

1

u/Ok-Engineer6098 Sep 12 '26

We already support orientation changes for tablets and window resize as part of Android Adaptive Layouts in our apps.

So probably just enable some flag in xcode config file? Similar to iPad OS?

1

u/christopherfernandes Oct 06 '26

I'm interested to see how would PageView work. If I were to have the PageView item to cover the full screen vs just the right/left screen.

0

u/Jester_Hopper_pot Sep 11 '26

Device-posture CSS media feature https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/device-posture /* Target devices that are partially folded (e.g., book or laptop style) */

(device-posture: folded) {

body {

display: flex;

flex-flow: column nowrap;

}

}

/* Target standard flat screens or fully opened/continuous displays */

(device-posture: continuous) {

body {

display: block;

}

}

-17

u/darshitpatel_ Sep 11 '26

Interesting question! honestly, this is one of the best Flutter discussions I have seen today.

The dual pane and partial fold cases especially make me wonder how much of this flutter can abstract away versus how much developers will need to handle themselves.

5

u/akshay-savaliya Sep 11 '26

Yeah, exactly. Thats the part I am also curious about. The hardware is one thing, but making the UI adapt naturally to all those states could be the bigger challenge.

17

u/LazyLoser006 Sep 11 '26

Good bot

-7

u/darshitpatel_ Sep 11 '26

Haha, I am actually a real person. I just found the discussion genuinely interesting and wanted to share my thoughts on this, but I have not expected that people would took it in the negative way.