/stackwise:flutter-expertfrom stackwise
Senior Flutter engineer skill for building features, state management (Riverpod/Bloc), GoRouter navigation, platform channels/FFI, and tests in Flutter 3.3x / Dart 3.x apps.
Ships in stackwise. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turns Claude into a senior Flutter engineer who ships idiomatic Dart 3 / Flutter 3.3x code with modern state management, correct navigation, and verified builds - not the 2021-era patterns that dominate training data.
pubspec.yaml (Flutter/Dart SDK constraints, state-management and router packages, code-gen deps), analysis_options.yaml (lint set), and lib/ layout before writing anything. Match the project's existing state-management choice - do not introduce Riverpod into a Bloc app or vice versa. Note whether the project uses code generation (build_runner, freezed, riverpod_generator, go_router_builder).switch expressions, records for lightweight tuples, pattern matching over manual casts, const constructors everywhere possible. Prefer code-gen providers (@riverpod) over manual ones, StatelessWidget/ConsumerWidget over StatefulWidget unless local ephemeral state is genuinely needed.@riverpod, @freezed, @JsonSerializable, or typed routes, run dart run build_runner build --delete-conflicting-outputs; if generation fails, fix the annotated source and re-run until it completes with no errors.dart format . then flutter analyze; fix all reported issues and re-run until clean before proceeding. Treat infos/deprecations (e.g. withOpacity, WillPopScope) as real work items, not noise.flutter test; fix all failures and re-run until every test passes. For flows spanning navigation or platform channels, add an integration_test (or patrol) case and run it on a device/emulator: flutter test integration_test; debug and re-run until it passes.flutter run -d <device> or the project's flavor variant, e.g. flutter run --flavor dev -t lib/main_dev.dart), exercise the changed flow, and check the console for exceptions and layout overflows. For performance work, confirm in DevTools (rebuild stats, frame chart) that the fix actually reduced rebuilds/frame times.Load detailed guidance only when the task needs it:
| Topic | Reference | Load When |
|---|---|---|
| State management: Riverpod 2/3 code-gen, AsyncNotifier, Bloc/Cubit, freezed models | references/state-riverpod-bloc.md | Adding/refactoring app state, async data loading, provider wiring, Bloc events/states, freezed/json_serializable models, or a "which state management" decision |
| Navigation: GoRouter routes, ShellRoute, redirect, deep links, typed routes | references/navigation-gorouter.md | Adding routes/tabs, auth-gated navigation, deep/app links, or nav-related bugs (back button, nested navigators) |
| Rebuild & render performance: const, keys, select, lists, DevTools | references/performance-widgets.md | Jank, dropped frames, "whole screen rebuilds", slow/scroll-stuttering lists, or any perf review |
| Platform integration: MethodChannel/EventChannel, Pigeon, dart:ffi; release flavors + signing | references/platform-integration.md | Calling Android/iOS native APIs, wrapping a C library, channel-related crashes, or setting up flavors/signing for release |
| Testing: widget tests, ProviderScope/Bloc overrides, goldens, integration_test, patrol | references/testing.md | Writing or fixing any Flutter test, flaky pumpAndSettle, mocking state/channels, device-level E2E |
Riverpod code-gen AsyncNotifier (the default for async app state):
@riverpod
class Cart extends _$Cart {
@override
Future<List<CartItem>> build() => ref.watch(cartRepoProvider).fetch();
Future<void> add(Product p) async {
state = const AsyncLoading();
state = await AsyncValue.guard(() async {
await ref.read(cartRepoProvider).add(p);
return ref.read(cartRepoProvider).fetch();
});
}
}
// In build(): exhaustive handling, no .when soup needed in Dart 3
switch (ref.watch(cartProvider)) {
AsyncData(:final value) => CartList(items: value),
AsyncError(:final error) => ErrorView(error),
_ => const CircularProgressIndicator(),
}
Sealed state + exhaustive switch (Bloc or plain):
sealed class LoginState {}
final class LoginIdle extends LoginState {}
final class LoginLoading extends LoginState {}
final class LoginFailure extends LoginState { LoginFailure(this.message); final String message; }
final class LoginSuccess extends LoginState { LoginSuccess(this.user); final User user; }
// switch (state) { ... } - compiler errors if a case is missed; no `default`.
GoRouter auth redirect that re-evaluates on state change:
final router = GoRouter(
refreshListenable: authNotifier, // re-run redirect when auth changes
redirect: (context, state) {
final loggedIn = authNotifier.isLoggedIn;
final loggingIn = state.matchedLocation == '/login';
if (!loggedIn && !loggingIn) return '/login?from=${state.matchedLocation}';
if (loggedIn && loggingIn) return state.uri.queryParameters['from'] ?? '/';
return null; // no redirect
},
routes: [/* ... */],
);
Rebuild only what changed:
// Watch one field, not the whole object:
final name = ref.watch(userProvider.select((u) => u.name));
// Scoped MediaQuery lookups (3.10+): rebuilds only on size changes
final size = MediaQuery.sizeOf(context);
StateProvider, StateNotifierProvider, ChangeNotifierProvider) in projects using riverpod_generator. Use @riverpod classes (Notifier/AsyncNotifier); StateNotifier is legacy and removed from Riverpod 3's core.ref.watch inside callbacks (onPressed, event handlers). watch is for build; use ref.read in callbacks and ref.listen for side effects like snackbars/navigation.BuildContext across async gaps without a context.mounted guard - a real crash and an analyzer lint (use_build_context_synchronously). Check if (!context.mounted) return; after every await before touching context.WillPopScope → PopScope(canPop:, onPopInvokedWithResult:); Color.withOpacity → withValues(alpha:); MediaQuery.of(context).size → MediaQuery.sizeOf(context); RaisedButton/FlatButton → ElevatedButton/TextButton; accentColor → colorScheme.secondary.Navigator.push with GoRouter - the imperative push bypasses the router's URL/state and breaks deep links and web URLs. Use context.go/context.push (and know the difference: go replaces the stack per route hierarchy, push stacks).ListView(children: [...]) for long/unbounded lists - builds everything eagerly. Use ListView.builder/.separated (with itemExtent or prototypeItem when heights are uniform), and give list items stable ValueKeys when reordering/removing.! and late to silence the compiler. Prefer promotion via patterns (if (user case User(:final email))), ??/?., and making fields non-nullable at construction; each ! and non-initialized late is a runtime crash waiting.pumpAndSettle in tests with repeating animations (shimmer, CircularProgressIndicator) - times out. Pump fixed durations instead (await tester.pump(const Duration(milliseconds: 300))).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
16 skills in this plugin
/docker-expertUse when working with Dockerfile, docker-compose.yml, .dockerignore, or multi-stage builds. Build, debug, secure, and optimize Docker 27+ images and Docker Compose services./engineering-rulesUse when writing, modifying, or reviewing code in any language or framework. Applies to every code task in this repo and every code sample inside a skill: new features, bug fixes, refactors, generated snippets, tests, scripts, docs with code. Enforces the seven repo-wide rules: reusable code, maintainable structure, top-notch readability, no AI slop, dead code removal, why-only comments, no em dashes. Invoke for implementing changes, self-reviewing a diff, cleaning up generated code, writing reference examples, or reviewing a PR./fastapi-expertUse when building or debugging FastAPI services - files importing fastapi, pydantic, or sqlalchemy.ext.asyncio; projects with pyproject.toml using uv/ruff/mypy; mentions of FastAPI, Pydantic v2, APIRouter, Depends, async endpoints, OAuth2/JWT auth, or pytest with httpx. Builds REST APIs, migrates Pydantic v1 to v2 idioms, wires async SQLAlchemy 2.0, adds auth and settings, writes async tests. Invoke for new endpoints, request/response schema design, dependency injection, lifespan/background tasks, auth flows, and test suites./fastify-expertUse when building or debugging Fastify services - files importing fastify, fastify-plugin, @fastify/* packages, or @sinclair/typebox; projects with a Fastify app factory, route plugins, or app.inject() tests; mentions of Fastify 5, encapsulation, decorators, hooks, TypeBox type provider, @fastify/jwt, or pino logging. Builds typed REST APIs, wires plugins and encapsulation correctly, adds JSON Schema validation and JWT auth, integrates Prisma/Drizzle/pg, writes inject-based tests. Invoke for new routes/plugins, schema-first request typing, auth flows, error handling, database wiring, and test suites./go-expertUse when writing or reviewing Go backend services - go.mod, *.go files, net/http handlers, pgx/sqlc database code, goroutines, context.Context plumbing, or failing `go test` runs. Builds HTTP APIs on the Go 1.22+ stdlib router, fixes error-wrapping and context-cancellation bugs, designs leak-free goroutine lifecycles with errgroup, and wires pgx/sqlc data layers. Invoke for HTTP routing, error handling, concurrency, database access, slog logging, project layout, or table-driven tests./jetpack-compose-expertUse when working in a native Android Jetpack Compose project - build.gradle.kts with androidx.compose BOM or org.jetbrains.kotlin.plugin.compose, *.kt files containing @Composable functions, MainActivity with setContent, or mentions of Compose, Material 3, recomposition, ViewModel, StateFlow, Hilt, Room, or Navigation Compose. Builds screens, state management, navigation, DI, and tests for Kotlin 2.x / Compose BOM 2026 apps. Invoke for adding composable screens, fixing recomposition or jank, wiring ViewModel + StateFlow collection, type-safe navigation routes, Hilt setup, Room + Flow data layers, side-effect handling, and Compose UI tests.npx claudepluginhub aarvion-ai/stackwise-skills --plugin stackwise