Iphone Duo Flutter logo

Iphone Duo Flutter

Community
mirzaaghazadeh
iphone-duo-flutter

Adapt a Flutter app to iPhone Duo, Apple's first foldable iPhone — what MediaQuery gives you today, why displayFeatures does not work here, and how to bridge the iOS 27.1 reserved-region, hinge and arrangement APIs through platform channels. Use when a Flutter or Dart app needs foldable iPhone support.

Overview

Publishermirzaaghazadeh
Repositoryiphone-duo-skills
Skill nameiphone-duo-flutter
Stars
188
Forks
9
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by mirzaaghazadeh on GitHub. Read the source before you install it.

Installation

Install the Iphone Duo Flutter AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-flutter
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mirzaaghazadeh/iphone-duo-skills.git /tmp/iphone-duo-skills
mkdir -p .claude/skills
cp -r /tmp/iphone-duo-skills/skills/iphone-duo-flutter .claude/skills/iphone-duo-flutter
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Iphone Duo Flutter in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Iphone Duo Flutter on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Iphone Duo Flutter is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Flutter on iPhone Duo

Start here, because it is the thing that will waste your afternoon otherwise:

MediaQuery.displayFeatures is documented as "populated only on Android."

Flutter's foldable abstraction was built for Android hinges. On iPhone Duo it returns an empty list, no matter how folded the device is. The same goes for the dual_screen package (TwoPane, hingeAngleEvents) — Android-only in practice, and last published around three years ago.

So Flutter gives you no fold awareness on this device out of the box. What it does give you is most of what actually matters. Work in two tiers.

Tier 1 — works today, no native code

This is the bulk of a good port, and it is all pure Dart.

Resize correctly

iPhone Duo changes your app's size constantly: opening, closing, folding, rotating, and entering Split View. Flutter handles the mechanics, but only if your layout is driven by constraints rather than constants.

  • Use LayoutBuilder and its BoxConstraints for layout decisions.
  • Use MediaQuery.sizeOf(context) when you need the window, not MediaQuery.of(context) — the sizeOf/paddingOf accessors rebuild only on the property you read, which matters when the size changes this often.
  • Never cache a size in initState or a field. It will be stale within seconds.

Handle asymmetric safe areas

This is the one that produces real bugs. On iPhone Duo the system puts its controls on one side, so insets are routinely asymmetric — and which side depends on the pose and on which half of a Split View you occupy.

MediaQuery.paddingOf(context) returns EdgeInsets with independent left, top, right, bottom. Use each one. Any expression of the form width - padding.left * 2 is a defect on this device.

The SafeArea widget handles all four edges independently already, so prefer it over hand-rolled padding. Where you need artwork to bleed underneath, put the background outside the SafeArea and only the interactive foreground inside it.

Replace breakpoints with size-class thinking

iOS reasons about this device in size classes: the outer display is compact width, the inner display is regular width. Flutter has no size classes, so map to width breakpoints — the Material 3 window size classes are a reasonable proxy (compact < 600, medium 600–840, expanded ≥ 840 logical pixels).

Two rules:

  • Branch on the constraints you were handed, not on Platform.isIOS, a device model string, or MediaQuery.orientationOf. The inner display does not honor supported orientations, so orientation is not a reliable signal.
  • Pick breakpoints from where your content stops working, then sanity-check that a compact/regular split falls out of it.

Prefer adaptive containers

NavigationRail for wide layouts and NavigationBar for narrow ones is the Flutter analogue of what iOS does natively when it moves controls to the side. A rail on the inner display and a bar on the outer display will feel close to right, and costs one breakpoint.

Tier 2 — needs a platform channel

Everything genuinely iPhone Duo-specific is unavailable to Dart until you bridge it. As of this writing no Flutter release has shipped iPhone Duo support, so plan on writing this yourself, and check whether it has landed before you do.

What is worth bridging, in priority order:

Native API (iOS 27.1)Why you'd want it in Dart
reservedRegions(kind:) on UIViewKeep controls out of the fold and out of the under-display camera
UIHingeInteractionContinuous hinge angle for effects
Size class from traitCollectionThe real signal iOS uses, rather than your breakpoint guess

How to shape the bridge

Use a MethodChannel for one-shot queries (current reserved regions, current size class) and an EventChannel for anything continuous — the hinge angle is a live stream and will spam a MethodChannel.

On the iOS side, in the Runner target, register a FlutterMethodChannel and a FlutterEventChannel on the FlutterViewController, then read the native APIs from that view. The reserved-region APIs hang off UIView, and the FlutterViewController's view is the right one to query — that is the view your Dart layout actually occupies.

Serialize regions as plain maps ({left, top, width, height, kind, active}) so Dart gets something it can rebuild Rects from. Send the region list on change rather than polling.

Guard everything: the hinge is nil on every non-folding device, and these APIs do not exist below iOS 27.1. Your bridge must degrade to "no regions, no hinge" rather than throw, because the same Flutter binary runs on every iPhone.

Then use it like Tier 1

Once regions arrive in Dart, feed them into the same constraint-driven layout you already built. A division region (the fold) tells you where to not put interactive widgets; an occlusion region (the camera) tells you what to avoid covering. Stack with Positioned, or a custom MultiChildLayoutDelegate, is usually the cleanest way to displace a specific control around a region.

What to do, in order

  1. Make the app resize cleanly under LayoutBuilder. Most bugs die here.
  2. Audit every use of MediaQuery.padding for symmetric-inset math.
  3. Replace orientation and platform checks with constraint-based branching.
  4. Add a rail/bar split so the inner display isn't just a stretched phone layout.
  5. Only then, if the app genuinely needs fold awareness, write the channel.

Steps 1–4 get a Flutter app most of the way to feeling right on iPhone Duo, and they improve it on tablets and desktop at the same time. Step 5 is the only part that is iPhone Duo-specific, and it is the only part that can't be tested without the Xcode 27.1 simulator.

For what the native APIs actually do and why, read ../iphone-duo-adaptive-layout/SKILL.md and ../iphone-duo-readiness/SKILL.md — the design reasoning transfers directly even though the code doesn't.

Frequently asked questions

What does the Iphone Duo Flutter AI skill do?

Adapt a Flutter app to iPhone Duo, Apple's first foldable iPhone — what MediaQuery gives you today, why displayFeatures does not work here, and how to bridge the iOS 27.1 reserved-region, hinge and arrangement APIs through platform channels. Use when a Flutter or Dart app needs foldable iPhone support.

Why use Iphone Duo Flutter on TypingMind?

Because you install it once and use it with any model. Iphone Duo Flutter is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Iphone Duo Flutter in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-flutter. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Iphone Duo Flutter?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Iphone Duo Flutter?

As many as you like. As long as a model supports skills, you can use Iphone Duo Flutter with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Iphone Duo Flutter AI skill free?

It is published on GitHub by mirzaaghazadeh. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇