Логотип Iphone Duo Flutter

Iphone Duo Flutter

Сообщество
mirzaaghazadeh
iphone-duo-flutter

Адаптируйте приложение на Flutter для iPhone Duo — первого складного iPhone от Apple. Узнайте, какие данные MediaQuery предоставляет сегодня, почему displayFeatures здесь не работает и как связать API зарезервированных областей, шарнира и компоновки в iOS 27.1 через платформенные каналы. Используйте это решение, если вашему приложению на Flutter или Dart нужна поддержка складного iPhone.

Add to TypingMind

Обзор

Издательmirzaaghazadeh
Репозиторийiphone-duo-skills
Название навыкаiphone-duo-flutter
Звёзды
188
Форки
9
Файлы в комплекте
Только инструкции
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — mirzaaghazadeh. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Iphone Duo Flutter в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-flutter
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

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
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Iphone Duo Flutter в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Iphone Duo Flutter, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Iphone Duo Flutter не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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.

Часто задаваемые вопросы

Что делает навык ИИ Iphone Duo Flutter?

Адаптируйте приложение на Flutter для iPhone Duo — первого складного iPhone от Apple. Узнайте, какие данные MediaQuery предоставляет сегодня, почему displayFeatures здесь не работает и как связать API зарезервированных областей, шарнира и компоновки в iOS 27.1 через платформенные каналы. Используйте это решение, если вашему приложению на Flutter или Dart нужна поддержка складного iPhone.

Зачем использовать Iphone Duo Flutter в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Iphone Duo Flutter — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Iphone Duo Flutter в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-flutter. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Iphone Duo Flutter?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Iphone Duo Flutter?

С любым количеством. В TypingMind вы можете использовать Iphone Duo Flutter с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Iphone Duo Flutter?

Навык опубликован на GitHub. Издатель — mirzaaghazadeh. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇