Skip to content
Skills Library
Programming · Building & coding

responsive-adaptive

/responsive-adaptive

Breakpoint rules and adaptive layout conventions for Flutter — LayoutBuilder for component decisions, MediaQuery for screen decisions, and the rule that the design artboard width is a reference and never a hardcoded target. Use this whenever writing layout code, whenever a RenderFlex overflow appears, whenever tablet or desktop or foldable support comes up, whenever a fixed pixel dimension is about to be written, and whenever a design only provides one artboard size. Trigger it on any layout task, because designs are delivered at a single width and code written to that width breaks everywhere

Licence
MIT
Last repository change
17.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 17.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Breakpoint rules and adaptive layout conventions for Flutter — LayoutBuilder for component decisions, MediaQuery for screen decisions, and the rule that the design artboard width is a reference and never a hardcoded target. Use this whenever writing layout code, whenever a RenderFlex overflow appears, whenever tablet or desktop or foldable support comes up, whenever a fixed pixel dimension is about to be written, and whenever a design only provides one artboard size. Trigger it on any layout task, because designs are delivered at a single width and code written to that width breaks everywhere

Original author description

Breakpoint rules and adaptive layout conventions for Flutter — LayoutBuilder for component decisions, MediaQuery for screen decisions, and the rule that the design artboard width is a reference and never a hardcoded target. Use this whenever writing layout code, whenever a RenderFlex overflow appears, whenever tablet or desktop or foldable support comes up, whenever a fixed pixel dimension is about to be written, and whenever a design only provides one artboard size. Trigger it on any layout task, because designs are delivered at a single width and code written to that width breaks everywhere

How it works

  1. Breakpoints
  2. Which tool for which decision
  3. Rules
  4. Orientation and foldables
  5. Common mistakes
Original SKILL.md headings · 69 lines, 495 words
SKILL.md preview
---
name: responsive-adaptive
description: Breakpoint rules and adaptive layout conventions for Flutter — LayoutBuilder for component decisions, MediaQuery for screen decisions, and the rule that the design artboard width is a reference and never a hardcoded target. Use this whenever writing layout code, whenever a RenderFlex overflow appears, whenever tablet or desktop or foldable support comes up, whenever a fixed pixel dimension is about to be written, and whenever a design only provides one artboard size. Trigger it on any layout task, because designs are delivered at a single width and code written to that width breaks everywhere else.
---

# Responsive and Adaptive Layout

A design file gives you one width. The app runs on hundreds. Every fixed dimension copied
from the artboard is a future overflow.

## Breakpoints

| Name | Width | Typical |
|---|---|---|
| compact | < 600 | phones, portrait |
| medium | 600–839 | small tablets, phones landscape, unfolded |
| expanded | ≥ 840 | tablets, desktop |

Define these once in `core/layout/breakpoints.dart`. Never inline a magic number
comparison in a widget.

## Which tool for which decision

**`LayoutBuilder`** for how a component lays itself out. It reports the space the widget
actually has, which is what the widget needs to know. A card in a 400pt sidebar on a
1200pt screen should lay out as a narrow card — `MediaQuery` would tell it the screen is
wide and it would be wrong.

**`MediaQuery`** for screen-level decisions: navigation pattern, number of grid columns
for the whole page, whether to show a modal or a side panel.

Reading `MediaQuery.sizeOf(context)` inside a leaf widget is almost always the wrong tool.
Note `sizeOf` rather than `MediaQuery.of(context).size` — the latter subscribes the widget
to every MediaQuery change including keyboard appearance, causing rebuilds on every
keystroke.

## Rules

**No hardcoded screen dimensions.** `width: 390` is a bug regardless of what the design
says. Fixed sizes are only valid for things that are genuinely fixed: an icon, an avatar,
a fixed-height app bar.

**Avoid percentage-of-screen sizing for text containers.** `width: screenWidth * 0.8`
looks fine at the design width and breaks at 2.0 text scale. Let content determine height
and constrain with `ConstrainedBox` where a maximum is genuinely needed.

**Scroll by default.** Any screen that can plausibly overflow — which is any screen with
more than three elements once text scale is raised — goes in a scroll view. Wrap fixed
layouts in `SingleChildScrollView` with `physics: ClampingScrollPhysics()` rather than
discovering the overflow on a small device.

**Handle the keyboard.** `resizeToAvoidBottomInset` plus a scroll view, or the form
disappears behind the keyboard on short screens.

**Safe areas are not optional.** `SafeArea` on every screen, and mind that a bottom
navigation bar needs the bottom inset while the content above it does not.

## Orientation and foldables

Do not lock orientation without a product reason. If landscape is supported, a
two-column layout above the medium breakpoint is usually the right move rather than
stretching a single column to 900pt — a text line longer than about 75 characters is
measurably harder to read.

## Common mistakes

- `MediaQuery.of(context).size.width * 0.44` to fit two cards in a row. Use
  `GridView` or `Expanded` — the arithmetic version breaks the moment padding changes.
- Testing only on the simulator's default device. Check the smallest supported device
  and the largest, at 2.0 text scale, before considering layout work finished.
- Using `Wrap` where `Flexible` was needed. `Wrap` moves the overflowing item to the
  next line, which is rarely what a design intends for a row of two elements.

Versions

RepositoryScoreLicence
This page · draz26648/flutter_craft_skills90MIT
dresar/ui-skill-2045100MIT

Database snapshot: 13.11.2026 · package version 540ed441b8e2 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100flutter-adaptive-ui
    Build, fix, review, and validate adaptive or responsive Flutter UIs for mobile, tablet, desktop, web, large screens, foldables, and mixed input devices. Use when creating breakpoint-driven layouts, responsive navigation, adaptive dialogs/lists/grids, keyboard/mouse/touch…
  • 100flutter-build-responsive-layout
    Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors.
  • 100adaptive-layout
    Enforces adapting layout by available CONSTRAINTS/size, never device or platform checks — LayoutBuilder + MediaQuery.sizeOf/paddingOf/viewInsetsOf (not .of) for narrow rebuilds, Material 3 window size classes (compact <600, medium 600-840, expanded 840-1200, large >1200) as the…
  • 100flutter-fix-layout-issues
    Use when fixing RenderFlex overflow errors, unbounded height and width exceptions, or ParentDataWidget layout conflicts.
  • 100flutter-build-responsive-layout
    Use when implementing adaptive Flutter layouts across mobile, tablet, desktop, and web screen dimensions.
  • 100flutter-layout
    Flutter layout and responsive design — the constraints model (constraints go down, sizes go up, parent sets position), Row/Column/Flex with Expanded and Flexible, Stack/Positioned, fixing RenderFlex overflow and 'unbounded height' / 'Vertical viewport was given unbounded height'…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.