No slash command · from flutter-plugin
Detects the installed Flutter state management library (Riverpod, Bloc, Provider, GetX, MobX, or plain ValueNotifier) and follows its conventions for async state modeling, repository boundaries, and side effects.
Ships in flutter-plugin. 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.
None: SKILL.md is the whole skill.
| Signal in pubspec.yaml | Approach |
|---|---|
flutter_riverpod / hooks_riverpod | Riverpod; riverpod_annotation + riverpod_generator → code-gen @riverpod style |
flutter_bloc / bloc | Bloc or Cubit — mirror which one neighbouring features use |
provider (without Riverpod/Bloc) | ChangeNotifier + ChangeNotifierProvider |
get | GetX controllers — follow existing patterns, do not expand GetX's service-locator use |
mobx + flutter_mobx | Stores with @observable/@action + code-gen |
| none | ValueNotifier / ChangeNotifier + ListenableBuilder, constructor-injected repositories |
Never add a second library. If the BA spec seems to need one, list it in BLOCKERS.
Widget ──watches──▶ Notifier / Bloc / Controller ──calls──▶ Repository (interface) ──▶ API client / DB / platform
await api.… in widgets.package:flutter/material.dart (except foundation.dart for ChangeNotifier), never take a BuildContext.Every async screen has four states: loading, empty, error, data. Make the type force you to handle them.
Riverpod gives you AsyncValue<T>:
final orders = ref.watch(ordersProvider);
return switch (orders) {
AsyncData(:final value) when value.isEmpty => const OrdersEmpty(),
AsyncData(:final value) => OrdersList(orders: value),
AsyncError(:final error) => ErrorView(error: error, onRetry: () => ref.invalidate(ordersProvider)),
_ => const Center(child: CircularProgressIndicator.adaptive()),
};
Elsewhere, a sealed state:
sealed class OrdersState { const OrdersState(); }
final class OrdersLoading extends OrdersState { const OrdersLoading(); }
final class OrdersLoaded extends OrdersState { const OrdersLoaded(this.orders); final List<Order> orders; }
final class OrdersFailure extends OrdersState { const OrdersFailure(this.message); final String message; }
If the project uses a single state class with a status enum (common in Bloc codebases with copyWith), follow that instead.
riverpod_annotation is present:@riverpod
Future<List<Order>> orders(Ref ref) async {
final repo = ref.watch(orderRepositoryProvider);
return repo.fetchOrders();
}
@riverpod
class Cart extends _$Cart {
@override
List<CartItem> build() => const [];
void add(CartItem item) => state = [...state, item];
}
NotifierProvider / AsyncNotifierProvider (Riverpod 2+). Do not write new StateNotifierProvider/ChangeNotifierProvider code in a Riverpod 2+ project — they are legacy.ref.watch in build (widgets and providers) to depend; ref.read inside callbacks (onPressed) to act; ref.listen for side effects.ref.watch(provider.select((s) => s.total)).autoDispose (the code-gen default) for screen-scoped state; keepAlive: true only for genuinely app-wide state.ref.watch(orderProvider(orderId)).AsyncNotifier: set state = const AsyncLoading() then state = await AsyncValue.guard(() => repo.save(...)).ProviderScope(overrides: [...])).pubspec.lock before writing provider code:
Ref type (no FooRef, no generic); StateProvider / StateNotifierProvider / ChangeNotifierProvider live in package:flutter_riverpod/legacy.dart; Override and similar helper types in misc.dart. A failing provider is retried automatically — pass retry: (count, error) => null on the provider (or on ProviderScope) where a failure must surface immediately, e.g. a 401 or a validation error.FooRef; there is no automatic retry.bloc_concurrency) or an audit trail. Match neighbours.equatable/freezed or sealed classes so BlocBuilder skips identical emits.close() — guard long operations with if (isClosed) return;.BlocProvider(create: (_) => OrdersBloc(context.read<OrderRepository>())..add(const OrdersRequested())) at the route/screen level, not app-wide unless truly global.BlocBuilder / BlocSelector to rebuild; buildWhen to narrow.BlocListener for one-off effects (snackbar, navigation); listenWhen to narrow.BlocConsumer when both are needed.context.read<B>().add(...) in callbacks; never context.watch inside callbacks.hydrated_bloc.notifyListeners() once per logical change, after state is consistent.context.watch<T>() in build, context.read<T>() in callbacks, context.select<T, R>(...) to narrow.dispose(); ChangeNotifierProvider(create: ...) disposes for you, .value does not.Never trigger them from build. Use the listener primitive of the approach:
ref.listen(checkoutProvider, (prev, next) { if (next case AsyncError(:final error)) showError(context, error); }); inside build of a ConsumerWidget (listen is allowed there; it does not run the effect during build).BlocListener.addListener in initState, removed in dispose.RepositoryProvider / Provider at the app root, or get_it (+ injectable) if the project already registers services there.Dio inside a widget.TextEditingControllers (widget state) or in the notifier when validation depends on several fields — follow the project.InputDecoration.errorText or TextFormField.validator.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/flutter-conventionsFlutter project structure and widget conventions: app vs package detection, feature-first vs layer-first layout, widget composition and const discipline, StatelessWidget vs StatefulWidget lifecycle, BuildContext rules, keys, theming with ThemeData/ColorScheme/ThemeExtension, responsive and adaptive layout, accessibility (Semantics, text scaling, tap targets), localization with gen-l10n, assets and fonts, flavors, platform channels, secure storage, performance.
Use this skill to:
- Build screens from small, const, testable widgets.
- Manage widget lifecycle (controllers, subscriptions, animations) without leaks.
- Read styling from the theme and keep screens responsive and accessible.
- Add strings, assets, permissions and platform code the way the project already does.
Do NOT use this skill for:
- State management choice and patterns (see flutter-state-management).
- Routing and deep links (see flutter-navigation).
- Testing (see flutter-testing).
- Plain Dart idioms (see dart-foundation:dart-conventions).
/flutter-navigationNavigation in Flutter apps: detecting go_router / auto_route / Navigator, adding routes and nested navigation (ShellRoute / StatefulShellRoute for tab bars), typed routes with go_router_builder, path and query parameters, auth redirects and guards, deep links / Android App Links / iOS Universal Links, passing data between screens, returning results, web URL strategy.
Use this skill to:
- Register a new screen in the router the project already uses.
- Pass parameters safely and validate deep-link input.
- Protect routes behind authentication with redirects.
- Keep tab state with stateful shell routes.
Do NOT use this skill for:
- Widget structure (see flutter-conventions).
- State that drives navigation decisions (see flutter-state-management).
- Testing routes (see flutter-testing).
npx claudepluginhub aratkruglik/claude-sdlc --plugin flutter-pluginOther plugins' skills for the same job