Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

responsive-adaptive

/responsive-adaptive

Podaje zasady breakpointów dla Fluttera: LayoutBuilder dla komponentów, MediaQuery dla ekranu, bez sztywnej szerokości artboardu.

Licencja
MIT
Ostatnia zmiana repozytorium
17.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 17.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Podaje zasady breakpointów dla Fluttera: LayoutBuilder dla komponentów, MediaQuery dla ekranu, bez sztywnej szerokości artboardu.

Oryginalny opis (EN)

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

Jak działa

  1. Breakpoints
  2. Which tool for which decision
  3. Rules
  4. Orientation and foldables
  5. Common mistakes
Sekcje z nagłówków SKILL.md, w oryginale · 69 linii, 495 słów
Podgląd SKILL.md
---
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.

Wersje

RepozytoriumWynikLicencja
Ta strona · draz26648/flutter_craft_skills90MIT
dresar/ui-skill-2045100MIT

Migawka bazy z 13.11.2026 · wersja paczki 540ed441b8e2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100flutter-adaptive-ui
    Buduje, naprawia i weryfikuje adaptacyjne interfejsy Flutter na mobile, tablet, desktop, web i składane ekrany: breakpointy, nawigacja, MediaQuery, LayoutBuilder oraz obsługa myszy, klawiatury i dotyku.
  • 100flutter-build-responsive-layout
    Buduje układy dopasowujące się do rozmiaru ekranu z użyciem LayoutBuilder, MediaQuery oraz Expanded i Flexible, tak by UI dobrze wyglądał na telefonie, tablecie i desktopie.
  • 100adaptive-layout
    Wymusza układ zależny od dostępnych ograniczeń rozmiaru we Flutterze: LayoutBuilder, MediaQuery.sizeOf, klasy okien Material 3, wybór nawigacji według szerokości i układ lista-szczegóły.
  • 100flutter-fix-layout-issues
    Naprawia błędy przepełnienia RenderFlex, wyjątki nieograniczonej wysokości i szerokości oraz konflikty ParentDataWidget we Flutterze.
  • 100flutter-build-responsive-layout
    Pomaga implementować adaptacyjne układy Flutter dla ekranów mobilnych, tabletów, desktopów i przeglądarki.
  • 100flutter-layout
    Porządkuje układ i responsywność we Flutter, naprawia błędy przepełnienia i nieograniczonej wysokości oraz dobiera slivery.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.