No slash command · from flutter-plugin
Enforces Flutter project structure and widget conventions: app vs package layout, const discipline, StatelessWidget vs StatefulWidget lifecycle, theming, responsive/adaptive layout, accessibility, localization, and platform channels.
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.
Mirror what exists. The two common shapes:
lib/ lib/
app/ (App widget, router, theme) models/
features/ repositories/
orders/ services/
data/ (dto, api, repository) screens/
domain/ (entities, interfaces) widgets/
presentation/ (screens, widgets, providers|bloc)
l10n/ main.dart
main.dart
lib/main.dart only bootstraps: WidgetsFlutterBinding.ensureInitialized(), DI/setup, runApp(const App()). Flavors use main_<flavor>.dart files calling a shared bootstrap().order_list_tile.dart)._Header) may live in the screen file when they are not reused.const constructors everywhere they are possible, and const at call sites (prefer_const_constructors lint). A const subtree is never rebuilt.Order order or String title, not the whole state object.super.key in constructors: const OrderTile({super.key, required this.order});.build pure and cheap: no I/O, no allocation of controllers, no heavy computation. Precompute in state/notifiers.TextEditingController, AnimationController, ScrollController, FocusNode, a local toggle.initState, release them in dispose (every controller.dispose(), subscription.cancel()). Use SingleTickerProviderStateMixin / TickerProviderStateMixin for animations.didUpdateWidget, not by recreating state.flutter_hooks, useTextEditingController() etc. replace the boilerplate — follow the neighbours.await, check if (!context.mounted) return; (in a State: if (!mounted) return;) before using context — navigation, ScaffoldMessenger, Theme.of.BuildContext in fields or pass it to repositories/services.Theme.of, MediaQuery.sizeOf(context), AppLocalizations.of(context) are cheap lookups — call them in build, not in initState (use didChangeDependencies if needed outside build).MediaQuery.sizeOf / paddingOf / textScalerOf over MediaQuery.of(context) — they rebuild only when that aspect changes.ValueKey(item.id) on items of lists that can reorder, insert or delete — otherwise state attaches to the wrong row.Key('checkout_submit_button') (or a Keys constants class if the project has one) on widgets tests must find unambiguously.GlobalKey only for Form validation or truly cross-tree access; never as a substitute for state management.ListView.builder / ListView.separated / SliverList.builder for dynamic or long lists — never ListView(children: items.map(...).toList()) for unbounded data.CustomScrollView + slivers when a screen mixes headers, grids and lists.Theme.of(context).colorScheme (primary, onSurface, error, surfaceContainer…), text from Theme.of(context).textTheme (titleMedium, bodySmall). No Color(0xFF…) literals and no TextStyle(fontSize: …) in feature code.ThemeExtension<T> read via Theme.of(context).extension<AppSpacing>()!, or the project's existing tokens file.useMaterial3: true); match the project if it still uses Material 2. Support dark mode whenever the app defines darkTheme.Switch.adaptive, CircularProgressIndicator.adaptive) when the app targets iOS and already uses them.LayoutBuilder / MediaQuery.sizeOf(context).width breakpoints the project defines; no fixed pixel widths for containers.SafeArea on screen bodies that are not inside a Scaffold handling insets; keyboard: Scaffold.resizeToAvoidBottomInset stays default unless there is a reason.Flexible/Expanded and overflow: TextOverflow.ellipsis where truncation is acceptable.Shortcuts/Actions) for primary actions, no mobile-only gestures as the only path.IconButton(tooltip: l10n.deleteOrder, …) or Semantics(label: …).kMinInteractiveDimension).excludeFromSemantics: true; meaningful ones: semanticLabel.MergeSemantics; announce async results with SemanticsService.announce only when nothing visible changes focus.When l10n.yaml exists:
lib/l10n/app_en.arb) with an @key description, and to every other ARB file (translate if obvious, else copy the English text and list it in the report as needing translation)."itemsInCart": "{count, plural, =0{Cart is empty} =1{1 item} other{{count} items}}".flutter gen-l10n, or flutter pub get when generate: true) and read with AppLocalizations.of(context)!.itemsInCart(count) (or the project's context.l10n extension).Never concatenate translated fragments; never format dates/numbers by hand — use intl DateFormat / NumberFormat with the current locale.
pubspec.yaml under flutter: assets: (directory entries end with /). Provide 2.0x/ and 3.0x/ variants for raster images, or prefer SVG via flutter_svg if the project uses it.flutter_gen, reference assets via the generated Assets.images.logo instead of string paths.flutter: fonts:; reference through the theme's fontFamily, not per widget.MethodChannel('com.company.app/feature') per feature, wrapped in a Dart class behind an interface so it can be faked in tests; validate arguments on the native side; handle MissingPluginException on targets that lack the implementation.defaultTargetPlatform / kIsWeb (never Platform.isIOS on web — dart:io is unavailable there).AndroidManifest.xml and Info.plist (with a user-facing NS…UsageDescription); request at the moment of use with permission_handler (if installed) and handle "permanently denied".| Data | Store |
|---|---|
| Tokens, refresh tokens, credentials | flutter_secure_storage (Keychain / EncryptedSharedPreferences) |
| Small non-sensitive preferences | shared_preferences (SharedPreferencesAsync / SharedPreferencesWithCache on recent versions) |
| Structured local data / offline cache | the installed DB: drift, isar, hive, sqflite |
| Files | path_provider directories — getApplicationSupportDirectory for app data, never the documents dir for caches |
Opacity/ClipRRect animations over large subtrees — use FadeTransition, AnimatedOpacity, or pre-clipped images.RepaintBoundary around independently animating regions only when profiling shows a need.cached_network_image if installed) and size them (cacheWidth/cacheHeight) to the displayed size.compute/Isolate.run.select, BlocSelector, context.select).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aratkruglik/claude-sdlc --plugin flutter-plugin4 skills in this plugin
/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).
/flutter-state-managementState management in Flutter apps: detecting the installed approach and following it — Riverpod 2/3 (Notifier/AsyncNotifier, code-gen @riverpod, ref.watch/read/listen, overrides), Bloc/Cubit (events, sealed states, BlocBuilder/BlocListener/BlocSelector, hydrated_bloc), Provider (ChangeNotifier), and plain ValueNotifier/ChangeNotifier. Modelling loading/empty/error/data states, repository boundaries, side effects, dependency injection.
Use this skill to:
- Pick the right primitive inside the library the project already uses.
- Model async screen state so loading, error and empty are never forgotten.
- Keep business logic out of widgets and testable without Flutter.
- Trigger one-off effects (snackbars, navigation) without rebuild bugs.
Do NOT use this skill for:
- Ephemeral widget state like text controllers (see flutter-conventions — StatefulWidget).
- Navigation (see flutter-navigation).
- Testing notifiers and blocs (see flutter-testing).
Other plugins' skills for the same job