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

flutter

/flutter

Wspiera budowę aplikacji Flutter: kompozycja widgetów, zarządzanie stanem, wydajność metody build, platform channels i zachowanie renderowania stojące za większością przycinania klatek.

Licencja
MIT
Ostatnia zmiana repozytorium
24.10.2026

Ocena i bezpieczeństwo

100/ 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ść35 / 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 24.10.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

Wspiera budowę aplikacji Flutter: kompozycja widgetów, zarządzanie stanem, wydajność metody build, platform channels i zachowanie renderowania stojące za większością przycinania klatek.

Wyzwalacze z opisu

my flutter app is jankytoo many rebuildsriverpod or bloccall native code from flutter
Oryginalny opis (EN)

Use when building Flutter applications. Covers widget composition, state management, build-method performance, platform channels, and the rendering behavior behind most Flutter jank. Trigger on "my flutter app is janky", "too many rebuilds", "riverpod or bloc", "call native code from flutter". Do not use for store submission, signing, and rollout — see the mobile-release skill.

Jak działa

  1. Purpose
  2. When to Use
  3. Capabilities
  4. Inputs
  5. Outputs
  6. Workflow
  7. Best Practices
  8. Examples
  9. Notes
Sekcje z nagłówków SKILL.md, w oryginale · 108 linii, 668 słów
Podgląd SKILL.md
---
name: flutter
description: Use when building Flutter applications. Covers widget composition, state management, build-method performance, platform channels, and the rendering behavior behind most Flutter jank. Trigger on "my flutter app is janky", "too many rebuilds", "riverpod or bloc", "call native code from flutter". Do not use for store submission, signing, and rollout — see the mobile-release skill.
metadata:
  category: mobile
  version: 1.0.0
  tags: [flutter, dart, widgets, state-management, performance]
---

# Flutter

## Purpose

Build Flutter applications whose widget tree rebuilds only where it must. Flutter's performance model is simple and unforgiving: a `setState` at the top of the tree rebuilds everything below it.

## When to Use

- Building or reviewing a Flutter application.
- Choosing and applying a state-management approach.
- Diagnosing jank or excessive rebuilds.
- Integrating with platform-native code.

## Capabilities

- Widget composition and the `StatelessWidget`/`StatefulWidget` boundary.
- State management with Riverpod, Bloc, or Provider — and when plain state suffices.
- Build-method optimization: `const` constructors, selective rebuilds, keys.
- Async: `Future`, `Stream`, `FutureBuilder`, and their failure states.
- Platform channels for native functionality.

## Inputs

- The feature set and target platforms.
- The current state-management approach, if any.
- The jank or rebuild symptom, if debugging.

## Outputs

- A widget tree where rebuilds are scoped to what changed.
- State that is testable without a widget tree.
- Async UI that handles loading, error, and empty explicitly.

## Workflow

1. **Compose small widgets** — A 300-line `build` method rebuilds as one unit. Extracting subtrees into widgets is the primary performance tool in Flutter, not a style preference.
2. **Mark everything possible `const`** — A `const` widget is never rebuilt. This is the cheapest optimization available and most codebases leave it on the table.
3. **Scope the rebuild** — `Consumer`, `Selector`, or a Riverpod provider that watches one field. `setState` in a parent rebuilds every child that is not `const`.
4. **Handle all three async states** — Loading, error, and data. `FutureBuilder` without an error branch shows a spinner forever when the request fails.
5. **Profile in profile mode** — Debug mode is meaningfully slower and will mislead you in both directions. Use the DevTools timeline on a real device.

## Best Practices

- `const` constructors are the highest-leverage change in most Flutter codebases. Enable `prefer_const_constructors` in the linter and fix every warning.
- Never build a widget inside a `build` method as a function call (`Widget _buildHeader()`). It defeats the element-tree diffing entirely. Extract a real widget class.
- Keys matter when reordering or removing items from a list of stateful widgets. Without them, state attaches to the wrong item.
- Business logic does not belong in a widget. If it cannot be tested without pumping a widget tree, it is in the wrong place.
- `ListView.builder`, not `ListView(children: [...])`, for anything that could be long. The latter builds every child immediately.
- An `AnimationController` without a `dispose` is a leak that ticks forever.

## Examples

**Scoped rebuild versus a rebuild of everything:**

```dart
// Costly: setState here rebuilds the whole screen, including the static header
// and the entire list, on every counter tick.
class _DashboardState extends State<Dashboard> {
  int _count = 0;

  @override
  Widget build(BuildContext context) => Column(
    children: [
      const DashboardHeader(),         // const: spared, correctly
      OrderList(orders: widget.orders), // not const: rebuilt every tick
      Text('$_count'),
      ElevatedButton(onPressed: () => setState(() => _count++), child: const Text('+')),
    ],
  );
}

// Better: only the Text listening to the counter rebuilds.
class Dashboard extends ConsumerWidget {
  const Dashboard({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) => Column(
    children: [
      const DashboardHeader(),
      const OrderList(),
      Consumer(builder: (_, ref, __) => Text('${ref.watch(counterProvider)}')),
      ElevatedButton(
        onPressed: () => ref.read(counterProvider.notifier).increment(),
        child: const Text('+'),
      ),
    ],
  );
}
```

**Async with every state handled:**

```dart
switch (ref.watch(ordersProvider)) {
  AsyncData(:final value) when value.isEmpty => const EmptyState(),
  AsyncData(:final value) => OrderList(orders: value),
  AsyncError(:final error) => ErrorState(error: error, onRetry: _retry),
  _ => const LoadingSkeleton(),
}
```

## Notes

- Extracting a subtree into a `const` widget removes it from the rebuild path entirely — the framework short-circuits on identity. This is why "just extract widgets" is genuine performance advice in Flutter and not merely tidiness.
- `RepaintBoundary` isolates a subtree's painting. It helps when a small animated element sits inside an expensive static one, and hurts if applied indiscriminately.
- Impeller replaced Skia as the default renderer on iOS (and now Android), which eliminates the shader-compilation jank that used to affect first-run animations.

Wersje

RepozytoriumWynikLicencja
Ta strona · nimadorostkar/Claude-Skills-collection100MIT
ericrisco/rsc-harness100MIT
claude-dev-suite/claude-dev-suite100MIT
G1Joshi/Agent-Skills100MIT
ar4mirez/samuel100MIT
clawic/skills90MIT
dkbnull/hello-skill86MIT
xoai/sage85MIT
hairyf/skills85MIT

Migawka bazy z 28.10.2026 · wersja paczki 9dcca6bdfd8a (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

  • 95agent-flutter-developer
    Działa jako subagent od Flutter i Dart, zarządzania stanem w Riverpod i platform channels przy budowie aplikacji Flutter.
  • 100flutter-expert
    Wspiera budowę aplikacji wieloplatformowych we Flutter 3+ i Dart: widgety, zarządzanie stanem Riverpod lub Bloc, nawigacja GoRouter, implementacje platformowe i optymalizacja wydajności.
  • 100developing-with-flutter
    Rozwija aplikacje we Flutter na iOS, Androida i Web: architektura widgetów, zarządzanie stanem, platform channels i wdrożenie wieloplatformowe.
  • 95flutter-state-management-and-widget-design
    Opisuje zarządzanie stanem we Flutterze (Riverpod 2.x, BLoC i Cubit), optymalizację drzewa widgetów, niezmienny stan, routing GoRouter i czystą architekturę dla skalowalnych aplikacji.
  • 100flutter-architecture
    Podaje wzorce architektury aplikacji Flutter: struktura feature-first, clean architecture i zarządzanie stanem (Bloc, Riverpod, Provider), wstrzykiwanie zależności i dobór podejścia.
  • 100flutter-performance
    Optymalizuje przebudowy widgetów, zużycie pamięci, renderowanie i wydajność przewijania we Flutterze, przy diagnozie przycinania, ograniczaniu przebudów i poprawie list.

Uwagi i zgłoszenia

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