Skip to main content

Flutter UI implementationAI reads Lanhu designs and writes Dart by constraints

AI reads Lanhu layout JSON and needed images, picks Row, Column, Expanded or Stack by content relationship, writes the page in your Theme and widgets, then runs it to fix overflow.

Flutter · Dart · Widgets · Theme

Workflow preview

Lanhu design
MCP / Skill reads
AI writes the code
  1. 1
    Name the design and route
  2. 2
    AI reads layout and project
  3. 3
    Write the screen by constraints
  4. 4
    Analyze, run, compare
Works with MCP or Skill

How does AI use a Lanhu design to write a Flutter screen?

Flutter UI work usually involves splitting widgets, assigning constraints, referencing assets and connecting state before runtime checks. AI uses MCP or Skill to retrieve Lanhu layout JSON and images, reads the Theme, shared widgets and state management, then writes the Dart screen. With a Flutter environment, it can analyze, run and revise the layout.

Step 1

Your design and Flutter project
An accessible Lanhu design link, Flutter project directory, version, screen entry point and target devices.

Step 2

MCP / Skill reads the design
Original layout JSON that can be saved locally, plus supported images when needed. Access depends on your account permissions and the source response.

Step 3

AI implements in your project
AI writes Dart and the widget hierarchy in the project. Builds, runtime checks and device reviews remain part of Flutter.

What AI does in your Flutter project

Instead of copying dimensions, AI implements rows, columns, stacks and scrolling within parent constraints. It reuses your widgets, Theme and state management, and puts spacing, typography and asset references into the existing code structure.

Constraints first

Flutter work usually means splitting widgets and tuning parent constraints. AI translates design relationships into constraint language, not absolute positions.

The page rides your Theme

Shared widgets, Theme and nearby screens come first — no standalone main.dart to wire up yourself.

Content picks the layout

Long titles get Row and Expanded, a fixed header gets Column, overlaps get Stack.

Run it and fix RenderFlex

Analyze and run the screen; watch long text, keyboard, larger text and scrolling.

Choose widgets for the way content fits together

On a narrow screen, scroll the table horizontally to compare all columns.

Choose widgets for the way content fits together
Design cueAI follows project conventionsRun and compare
A long title beside an iconUse a Row and let the text flex within the available widthTry a longer title and check wrapping and RenderFlex overflow
A heading above a long listOnce the parent’s height is bounded, give the list the remaining spaceAdd rows and check that the last item stays reachable
A label over an imageUse a Stack for the intended overlapChange image proportions and label text to check placement and collisions
Buttons and text styles already used in the appLook in the Theme and shared widgets for suitable controlsCompare text, colors and disabled states with nearby screens

Have AI write Dart, then run and compare

From a Lanhu link to a running interface: AI reads the design through MCP or Skill, writes code in your project, then runs and compares.

  1. 1

    Name the design and route

    Lanhu link, project directory, version and devices.

  2. 2

    AI reads layout and project

    Retrieves JSON and images, then reads widgets, Theme and state management.

  3. 3

    Write the screen by constraints

    Reuse components, arrange constraints and scrolling, wire assets and interactions.

  4. 4

    Analyze, run, compare

    Check long titles, long lists, keyboard and RenderFlex overflow.

Before calling it complete: Long content and RenderFlex · Keyboard and page scrolling · Larger text and Theme

Keep the heading in place while the list scrolls

For a fixed header above a growing list, AI identifies the two design regions, checks the parent’s height, then writes Column, Expanded and ListView in the existing screen. Empty and long lists help verify the constraints.

Constraints go downSizes go up
  • SafeArea
    • Column
      • HeaderTakes the height its content needs
      • Expanded
        • ListViewScrolls within the remaining height

The header takes its height; the list uses the space left over.

An example layout with a bounded height. Choose the widget tree to suit the screen’s content.

Information in the Lanhu design

In the Lanhu design A few sample rows sit below the heading The list region extends to the bottom of the screen

AI implements in your project

In the Flutter project Confirm that the parent has a bounded height Use Expanded inside Column to give ListView the remaining space The heading stays in place while the list scrolls in its own region

Give this task to AI
Take responsibility for recreating this Lanhu design in the current Flutter project. Read original layout JSON and needed images through MCP or Skill. Inspect the Theme, shared widgets, routes, state management and nearby screens, then write Dart in the existing code style rather than creating a separate example project. Handle parent constraints, assets, scrolling and interactions; ask about unspecified states. If tools are available, run analysis and the screen, compare with the design, and fix long text, keyboard behavior, larger text and RenderFlex overflow. List checks you could not execute.

Have AI run Flutter and refine constraints

With a Flutter toolchain, have AI analyze the code, run the target screen, compare it with the design and revise widgets and constraints. Cover long lists, keyboards and larger text, and identify checks not run without device tools.

Use long content and check overflow and scrolling

Start with an empty list, add more than one screen of rows, and replace sample titles with realistic copy. Check wrapping, image proportions, the last row and any bottom action. When overflow appears, record the content, device size and affected widget region, then trace the constraints.

Open the keyboard, then try scrolling

Focus a bottom input and make sure the keyboard leaves the active content and submission action reachable. Drag the page and any nested list separately to see which region scrolls. After the keyboard closes, content should return to a sensible position.

Enlarge text and switch Theme

Use larger system text and longer translations. Check button labels, touch targets and semantics. If the project supports a dark theme, compare text, icons and backgrounds after switching, and record the Flutter version and devices you actually ran.

Connect to Lanhu with MCP or Skill

Choose the entry your AI tool supports. Configure your platform API Key locally and sign in to Lanhu. Give AI the design link and project directory, then ask it to read the design, inspect your code conventions and implement the UI. MCP and Skill provide the same design-reading capabilities.

AI needs access to your project to edit code and a working runtime to verify the result. MCP / Skill supplies design data, not a built-in engine converter. Enable image downloads locally when needed and follow your AI tool’s data settings.

Questions about Flutter implementation

Can I keep my project’s widgets and state management?

Yes. Have AI read existing screens, the Theme and state interfaces, then implement the UI in the same patterns. MCP or Skill supplies design data; the host AI writes Dart. Fonts, device sizes and dynamic content still need real runs to verify.

Do design coordinates become absolute positions?

No. AI picks Row, Expanded, ListView or Stack inside parent constraints based on content relationships; coordinates only inform how the design reads.

What are the platform API key and Lanhu cookie used for?

Configure the platform API key locally to verify your platform account and usage entitlement. Your Lanhu cookie is cached on your device, used only in requests to Lanhu, and is not uploaded to Core or the website.

Can I keep my existing components and state management?

Yes. Specify shared widgets, Theme and state management, and ask AI to read the relevant code first. Reading a design does not require a new state management library.

Can it download images and fonts?

It can download supported images on demand, but not fonts automatically. Supply font files in the project and confirm their license. Place downloaded images using the project’s conventions.

Experience Lanhu MCP Now

Create an account, get your API Key and choose MCP or the standalone Skill.

Your Lanhu login credentials stay on your device.