NewiPhone Duo, live in your browser. Try it →

iPhone Duo · Flutter

How to support iPhone Duo in a Flutter app

Rokas Kašinskas — Co-founder, VibeViewPublished 2026-11-07Updated 2026-11-07

You can follow this guide from Windows, Linux or a Mac: VibeView builds the app in the cloud and runs it on an iPhone Duo in your browser. Start free to follow along on your own app.

The iPhone Duo, Apple’s first foldable iPhone, went on sale on October 23. Closed, you use a 5.4-inch cover screen. Open, you get a 7.6-inch screen with a fold down its center (Apple Newsroom). Your Flutter app gets a new window size each time the device closes, opens or turns.

We built a small Flutter app for this guide, compiled it with VibeView cloud builds on Xcode 27.1, and ran it on VibeView’s iPhone Duo simulator. Every number and screenshot below comes from those sessions.

What Flutter tells your app on the Duo

Some of what the Duo changes reaches Dart today, and some doesn’t. This is what our app read on the iPhone Duo simulator (iOS 27.1), built with Flutter 3.47.7 and the iOS 27.1 SDK:

Where the app isMediaQuery.sizeOf (points)MediaQuery.paddingOf (points)displayFeatures
Cover screen, portrait466×678right 84, bottom 34empty
Cover screen, landscape678×466right 84, bottom 34empty
Inner screen, open951×669right 84, bottom 34empty
Inner screen, partly folded (110°)951×669right 84, bottom 34empty
Inner screen, open and rotated669×951top 82, bottom 34empty

Our demo prints these values in a debug line at the bottom of its list, which you can see in the screenshots below. Three things follow from that table.

  • The window size is right, and it updates. Every fold, unfold and rotation rebuilt our widgets with the new size. Sizing the layout from the window is enough.
  • The padding is uneven. On the cover screen and the open inner screen, the status bar is a block in the top-right corner. Flutter’s safe area still treats it as an 84-point inset along the entire right side, with a top inset of 0. Turned to landscape, the cover screen hides the status bar but reports the same right and bottom insets. paddingOf gives you each edge separately.
  • The fold is invisible. displayFeatures stayed empty even while the device was partly folded. Flutter’s DisplayFeature reference says it is “populated only on Android” (Flutter API). A proposal to fill it from the iPhone Duo’s fold, flutter/flutter#192515, is open, and so is a pull request for it, #193025.

Flutter also has no hinge-angle API on iOS yet (#193054) and no counterpart to Apple’s arrangement view (#193059). The steps below work around both with plain Dart.

Step 1: build with Flutter 3.41+ and Xcode 27.1

Three things decide whether your app builds, launches and fills the Duo’s screen.

The scene life cycle. An app compiled against the iOS 27 SDK must use UIKit’s scene life cycle, or iOS 27 refuses to start it. Flutter’s 3.47 release notes say: “Apps built with Xcode 27 that do not adopt UIScene will fail to launch on startup” (Flutter blog). Flutter 3.41 and later handle most of this for you (Flutter docs). New apps use scenes, and the Flutter tool migrates an unmodified AppDelegate on the next flutter build ios or flutter run. If you customized yours, UIScene life cycle is required: fix it for Xcode 27 lists the changes.

The iOS 15 deployment target. Xcode 27.1 won’t compile a project whose deployment target is under iOS 15.0. Flutter 3.47 raises its own minimum iOS version from 13 to 15, and its flutter create template targets 15.0. On Flutter 3.41 to 3.46, raise the Runner project’s iOS deployment target to 15.0 yourself. Raise the platform :ios line in ios/Podfile too, if your project has one.

The SDK. Compiled against anything before the iOS 27 SDK, your Flutter app shows as a phone-sized window, centered, with black on both sides of the inner screen. Compiled against iOS 27.1, it uses the full screen. Building with Xcode 27.1 locally takes an Apple silicon Mac running macOS 26.6 or newer. Build for iPhone Duo with Xcode 27.1 shows what each SDK version looks like on the Duo.

You don’t need that Mac. VibeView cloud builds run Flutter and Xcode on VibeView’s Macs. Add "xcode": "27.1" to the iOS build in vibeview.json:

{
  "platforms": {
    "ios": {
      "build": {
        "xcode": "27.1",
        "profiles": {
          "development": {
            "command": "flutter build ios --simulator --debug",
            "artifact": "build/ios/iphonesimulator/Runner.app"
          }
        }
      }
    }
  }
}

Then run vibeview build --cloud --platform ios from the folder with pubspec.yaml. Our build log opened with Xcode 27.1, iOS SDK 27.1 and Flutter 3.47.7, and each of our builds finished in about a minute. If your project needs another Flutter release, Build a Flutter app in the cloud shows how to pin one.

Step 2: decide the layout from the window

Flutter’s adaptive design docs already say what the Duo needs: “your choice shouldn’t depend on the type of device, but on the device’s available window size” (Flutter docs). They also recommend MediaQuery.sizeOf(context) over MediaQuery.of(context), so a widget rebuilds only when the size changes.

Put the decision in one function:

import 'dart:math' as math;
import 'package:flutter/widgets.dart';

({bool twoPanes, Axis axis}) layoutFor(Size window) {
  final shortSide = math.min(window.width, window.height);
  final longSide = math.max(window.width, window.height);
  return (
    twoPanes: shortSide >= 600 && longSide >= 640,
    axis: window.width > window.height ? Axis.horizontal : Axis.vertical,
  );
}

Call it with MediaQuery.sizeOf(context) in build. With the sizes from the table, the cover screen gets one pane in either orientation. The open inner screen gets two side by side, and the rotated one gets two stacked. Nothing in it names the Duo, so an iPad gets two panes as well, and a landscape iPhone keeps one.

Where the numbers come from: 600 points is where Material’s window size classes move from compact to medium, which Flutter’s docs use for switching navigation styles. The 640 floor means each pane is at least 300 points long, after the 40-point gap.

Two habits keep it working:

  • Don’t lock orientation. Flutter’s large screens guide recommends against it and explains how a lock breaks Android foldables. On the Duo there is a simpler reason: the inner screen opens in landscape, so a portrait-only app fights the device.
  • Keep the selection in state, not in a pushed route. Our first version pushed a detail page with Navigator.push on the cover screen. After unfolding, that page still covered the whole inner screen, and the two panes only appeared after Back. Keeping the selected item in state and choosing what to show in build fixed it.

Step 3: split the whole window, and pad by edge

On the inner screen the fold is a band about 40 points wide, centered in both orientations. Without a fold position from Flutter, split the full window into two equal halves with a 40-point gap between them. On the 951-point-wide inner screen, that gap covers 455.5 to 495.5 points, which is where UIKit puts the fold.

Do the split above any app bar. Our first version split the body of one Scaffold, with a debug line under it. When rotated, the app bar and that line moved the body’s middle. The gap sat about 36 points below the fold, covering only 4 points of it. How far it misses depends on what sits above and below your split. Give each pane its own Scaffold instead:

@override
Widget build(BuildContext context) {
  final layout = layoutFor(MediaQuery.sizeOf(context));
  final list = TripList(selected: selected, onTap: (i) => setState(() => selected = i));
  final detail = TripDetail(
    index: selected,
    onBack: layout.twoPanes ? null : () => setState(() => selected = null),
  );

  if (!layout.twoPanes) {
    return PopScope(
      canPop: selected == null,
      onPopInvokedWithResult: (didPop, _) {
        if (!didPop) setState(() => selected = null);
      },
      child: selected == null ? list : detail,
    );
  }

  final sideBySide = layout.axis == Axis.horizontal;
  return ColoredBox(
    color: Theme.of(context).colorScheme.surface,
    child: Flex(
      direction: layout.axis,
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [
        Expanded(
          child: MediaQuery.removePadding(
            context: context,
            removeRight: sideBySide,
            removeBottom: !sideBySide,
            child: list,
          ),
        ),
        SizedBox( // the gap over the fold
          width: sideBySide ? 40 : null,
          height: sideBySide ? null : 40,
        ),
        Expanded(
          child: MediaQuery.removePadding(
            context: context,
            removeLeft: sideBySide,
            removeTop: !sideBySide,
            child: detail,
          ),
        ),
      ],
    ),
  );
}

This build lives in a State class that holds int? selected, and it needs package:flutter/material.dart. TripList and TripDetail are ordinary widgets that each return a Scaffold with an AppBar, and TripDetail shows a placeholder while selected is null. On one pane, PopScope turns the back gesture into “back to the list” instead of leaving the app.

MediaQuery.removePadding drops the insets on the side a pane shares with the fold, so only the outer pane keeps the 84-point right inset. Inside a pane, the app bar already handles the top inset. Wrap the body in SafeArea(top: false) for the sides and bottom.

The demo Flutter app on the unfolded iPhone Duo in landscape: a Trips list on the left half with Lisbon selected, a gray band down the middle, and Lisbon's packing list on the right half. The status bar is a small block at the top right.
Open on the inner screen. The gray band is the 40-point gap, tinted for this screenshot, and it covers the fold. Lisbon was selected before unfolding, and stays selected.
The demo app on the iPhone Duo's cover screen: one Trips list, the status bar as a block at the top right, and a debug line reading window 466x678, padding L0 T0 R84 B34, displayFeatures 0.
Closed, on the cover screen: one pane. The status bar sits top right, and Flutter reports an 84-point right inset.
The demo app on the open iPhone Duo turned to portrait: the Trips list on the top half, a gray band across the middle, and Lisbon's packing list on the bottom half, each with its own title bar. The debug line reads window 669x951, padding T82 B34.
Open and rotated: the panes stack, and the tinted 40-point gap sits across the fold.

When you need the fold’s exact position

A 50/50 split is enough for most list-and-detail screens. For more, such as a video above the fold and controls below it, you need the fold’s frame and whether it is active. iOS 27.1 reports it as a reserved region: Apple’s guide says the fold “is active when iPhone Duo is partially open, but inactive when it is fully open” (Apple).

Until Flutter passes that through, a platform channel can. Write your own, or use a community package such as foldable, which reads the hinge angle, the posture and the fold over a channel. It leaves MediaQuery.displayFeatures alone by default, and its docs say it steps aside once Flutter fills that list.

Step 4: fold, unfold and rotate it

Most Flutter layout bugs on the Duo show up in the move from one posture to the next, not in any single one. For the layout above, this is what to check:

  1. Cover screen, portrait and landscape: one pane, with nothing under the 84-point right inset.
  2. Unfold: two panes, the selection kept, and no detail page left on top.
  3. Partly fold to 110 and 75 degrees: at 110 the layout stays the same. At 75 the device may switch to the cover screen, depending on where it was before.
  4. Turn the open device: the panes stack, and the gap stays on the fold.
  5. Fold shut from each state, with and without a selection: back to one pane, and Back still returns to the list.

In your browser, on VibeView’s iPhone Duo

VibeView hosts the iPhone Duo simulator and streams it to any browser, so you can test from Windows or Linux too. It is Apple’s own iPhone Duo simulator, so sizes, postures and rotation are the same as in Xcode. It can’t reproduce the physical hinge, the sensors or the device’s speed.

  1. Build the app on Xcode 27.1 (see Step 1).
  2. Start it. In Devices, pick the Foldable entry iPhone Duo (iOS 27.1) and your build. Sessions begin folded shut, so your app first appears on the cover screen.
  3. Fold it. In the Device tab, switch between Closed, Partial and Open. For an exact angle, turn on Set by angle. Rotate turns the device in any posture.

From the command line, or a coding agent

Everything above also runs from the VibeView CLI. This is the loop we used for this guide:

npm install -g vibeview && vibeview login
vibeview build --cloud --platform ios
vibeview dev --detach --platform ios --model "iPhone Duo"
vibeview set-posture open
vibeview set-posture --angle 110
vibeview rotate
vibeview ui-tree
vibeview screenshot --out open.png
vibeview set-posture closed
vibeview dev-stop

In a Flutter project, vibeview dev installs and opens the build you just made. Every set-posture reply reports the posture, the hinge angle and which screen is lit (cover or inner). Read that reply before the next step. As on the hardware, the path to an angle decides which screen is lit, so a requested posture isn’t always the one you get. Our demo’s debug line is ordinary text on screen, so vibeview ui-tree read it back. That is how we filled the table above without leaving the terminal.

Your coding agent can run this loop over MCP, with the dev_start, set_posture, rotate, ui_tree and screenshot tools. Ask it to “start my Flutter app on an iPhone Duo, open the hinge, and confirm the two panes leave the fold empty”, and watch the session live while it works. Set the iPhone Duo hinge angle from the command line has the full command list, and Agent Control covers the MCP setup.

Stop each session when you finish. An open session uses streaming minutes, and the pricing page has each plan’s allowance.

Flutter issues worth following

Most of Flutter’s GitHub issues about the Duo start their titles with [iPhone Duo]. Besides the fold and hinge proposals above, two open reports are worth knowing about before you ship:

  • A blank screen on an unfolded cold start on a physical Duo, with Flutter 3.47.7 (#195401). It doesn’t happen when the app starts folded.
  • A frozen app in top-and-bottom Split View on the open, upright inner screen (#195954).

Our run started folded and never used Split View, so it couldn’t show either. Check both on hardware before release.

Frequently asked questions

Does Flutter support the iPhone Duo?

Flutter apps run on it, and a build made with Flutter 3.41 or later and Xcode 27.1 fills the inner screen. Flutter reports the window size and safe-area insets as the device folds, but not the fold itself or the hinge angle on iOS yet. Proposals for both are open on GitHub.

Why is MediaQuery.displayFeatures empty on the iPhone Duo?

Flutter fills display features only on Android today, so on iOS the list stays empty in every posture. Split your layout at the middle of the window with a gap of about 40 points, or read the fold through a platform channel.

Why does my Flutter app sit in the middle of the Duo's inner screen?

It was built with an iOS SDK older than 27, so iOS runs it phone-sized in the middle. Rebuild with Xcode 27.1, on Flutter 3.41 or later and an iOS 15 deployment target.

Can I test a Flutter app on the iPhone Duo without a Mac?

Yes. Set the cloud build’s Xcode to 27.1, run it from any computer, and open the result on VibeView’s iPhone Duo in a browser. You can fold it from the Device tab or script it with vibeview set-posture.

Published November 7, 2026 · Tested on VibeView’s iPhone Duo simulator (iOS 27.1) with Flutter 3.47.7 and Xcode 27.1 · Flutter and Apple documentation checked November 7, 2026

Try it yourself

Open a live iOS simulator, Android emulator, Apple TV, Android TV or Roku in your browser.

Start free