Command Palette

Search for a command to run...

Назад к скиллам
скилл № 45723

flutter-expertise

Use when the user asks about a Flutter app, Riverpod, BLoC, Provider, go_router, widget rebuilds, jank, platform channels, golden tests, flavors or Flutter…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить flutter-expertise в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Flutter

Purpose

Flutter renders its own UI from a declarative widget tree, so app quality depends on keeping rebuilds narrow, state ownership clear, and heavy work off the UI isolate. This skill provides the default architecture, state-management decision rules, current Riverpod/BLoC APIs, performance techniques and the testing pyramid for production Flutter apps.

Agent Protocol

Trigger

"Flutter", "widget rebuild", "Riverpod", "BLoC", "Provider", "go_router", "Flutter performance", "jank", "const widget", "platform channel", "golden test", "flavors".

Input Context

  • Flutter/Dart versions (flutter --version, pubspec.yaml), target platforms
  • Current state-management and navigation packages
  • Symptom (jank, memory, build size) with DevTools data if available

Output Artifact

Dart code, folder structure, pubspec.yaml changes, test code or a performance plan. No file unless requested.

Response Format

Flutter/Dart: {versions}
Layer: {UI | state | data | platform}
Change: {what and why}
Code: {snippet}
Verify: {flutter test / DevTools trace / golden diff}

1. Project Structure (feature-first)

lib/
  main.dart                 // ProviderScope / BlocProvider roots, app config per flavor
  app/router.dart           // go_router configuration
  features/orders/
    data/                   // DTOs, API clients, repositories (implementations)
    domain/                 // entities, repository interfaces, use cases (pure Dart)
    presentation/           // widgets, controllers/notifiers/blocs
  core/                     // theming, networking, error types, utils

Keep domain free of Flutter imports so it unit-tests without a device. See references/architecture.md.

2. Choosing State Management

Option Fits Notes
setState / ValueNotifier local, ephemeral widget state do not lift everything into global state
Riverpod 3 app-wide state, DI, async data, testability compile-safe providers; Notifier/AsyncNotifier APIs
BLoC / Cubit (flutter_bloc) teams wanting explicit events → states, strong tracing more boilerplate; great for complex flows
Provider + ChangeNotifier existing apps, simple DI Riverpod is its successor by the same author

Riverpod 3 (current API)

StateProvider, StateNotifierProvider and ChangeNotifierProvider are legacy in Riverpod 3 (importable from package:flutter_riverpod/legacy.dart). New code uses Notifier/AsyncNotifier:

import 'package:flutter_riverpod/flutter_riverpod.dart';

final counterProvider = NotifierProvider<Counter, int>(Counter.new);

class Counter extends Notifier<int> {
  @override
  int build() => 0;
  void increment() => state++;
}

final ordersProvider = AsyncNotifierProvider<OrdersController, List<Order>>(OrdersController.new);

class OrdersController extends AsyncNotifier<List<Order>> {
  @override
  Future<List<Order>> build() => ref.watch(orderRepositoryProvider).fetchOrders();

  Future<void> refresh() async {
    state = const AsyncLoading();
    state = await AsyncValue.guard(() => ref.read(orderRepositoryProvider).fetchOrders());
  }
}

class CounterText extends ConsumerWidget {
  const CounterText({super.key});
  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final count = ref.watch(counterProvider);           // rebuilds only when the int changes
    return Text('Count: $count');
  }
}
  • ref.watch in build, ref.read in callbacks, ref.listen for side effects (snackbars, navigation).
  • select to rebuild on part of a state: ref.watch(userProvider.select((u) => u.name)).
  • Riverpod 3 providers compare with == before notifying; give state classes value equality (records, freezed, equatable).
  • Code generation (@riverpod with riverpod_generator) is optional and produces the same providers.

BLoC

Use BlocBuilder with buildWhen, BlocSelector for slices, BlocListener for one-off effects; model states as a sealed class hierarchy and switch exhaustively.

3. Navigation

go_router for declarative, URL-based routing (deep links, web, redirects for auth guards); StatefulShellRoute for bottom-nav tabs with preserved stacks. Avoid mixing imperative Navigator.push and router-driven navigation for the same flows.

4. Performance

  • const constructors so unchanged subtrees are skipped; split large build methods into small widgets (not helper methods returning widgets) so rebuilds stay local.
  • Lists: ListView.builder/SliverList with itemExtent or prototypeItem for fixed heights; never build thousands of children eagerly.
  • Avoid Opacity and ClipPath in animated subtrees (they can force offscreen layers); use AnimatedOpacity/FadeTransition or color alpha. RepaintBoundary isolates frequently repainting widgets — verify with the DevTools repaint overlay rather than adding it everywhere.
  • Images: size them (cacheWidth/cacheHeight), cache network images
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/architecture.md
  • references/flutter-advanced.md
  • references/flutter-fundamentals.md
  • references/platform-channels.md
  • references/state-management-provider.md
  • references/testing.md
  • references/widgets.md

FAQ

Что делает скилл flutter-expertise?

Use when the user asks about a Flutter app, Riverpod, BLoC, Provider, go_router, widget rebuilds, jank, platform channels, golden tests, flavors or Flutter release builds. Produces Flutter project structure, state management choices, performance fixes and tests. Not for engine and rendering internals (use flutter-internals) or Dart language features (use lang-dart).

Как установить скилл flutter-expertise?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл flutter-expertise запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить flutter-expertise с