/flutter-helper-utils:use-flutter-helper-utilsfrom Flutter Helper Utils
Guides correct usage of the flutter_helper_utils package: imports, version-specific APIs, and avoiding invented members. Use when writing or reviewing Flutter code that depends on FHU.
Ships in Flutter Helper Utils. 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.
flutter_helper_utils (FHU) is a curated Flutter utility package. Agents reliably produce v8 names that were REMOVED in v9 and invent members that never existed - use the exact names below instead of memory.
import 'package:flutter_helper_utils/flutter_helper_utils.dart'; gives:
PlatformEnv,
AsyncSnapshot helpers, and everything in sugar.dart.package:dart_helper_utils (DHU) - which itself re-exports all
of collection, all of convert_object, all of stringo, and exactly five intl symbols
(Bidi, BidiFormatter, DateFormat, Intl, NumberFormat).import 'package:flutter_helper_utils/sugar.dart'; ALONE is the opt-in
shortcut subset (context navigation/media-query/theme/scroll extensions,
num/Size sugar, int.color, platform checks) WITHOUT the DHU re-export,
colors, PlatformEnv, or widgets.
Consequences:
dart_helper_utils, collection, convert_object, or stringo imports
next to the main FHU import - it already provides them, and duplicates
invite ambiguous-extension errors.grep -A2 'flutter_helper_utils' pubspec.lock. This
skill documents 10.x. For 9.x projects, apply the
migrate-flutter-helper-utils-v9-to-v10 skill. For 8.x-or-older projects, use the
migrate-flutter-helper-utils-v8-to-v9 skill before writing new code.grep -rn "flutter_helper_utils" lib/ | head to
see which import the project uses; do not mix idioms in one file.Import package:material_ui/material_ui.dart directly alongside FHU when
using Material UI. FHU does not re-export it. The theme, scaffold/messenger,
feedback, carousel and page-route types belong to material_ui in 10.x;
SDK Material types with identical names are distinct. Match MaterialApp,
Theme, Scaffold, SnackBar and CarouselController ancestors/types together.
Flutter BuildContext, Widget, Color, Navigator and Route remain shared.
The deprecated MaterialUiCompatibilityBridge only supplies mapped legacy
theme/localizations beneath a modern app. It does not convert objects or
provide legacy scaffold/messenger states. Use the v9-to-v10 migration skill
when an app still relies on SDK Material.
| Task | WRONG guesses | Actual API |
|---|---|---|
| Text theme | context.txtTheme | context.textTheme (also primaryTextTheme) |
| Screen size | screenWidth, screenSize | context.widthPx, context.heightPx, context.sizePx (+ nullableWidthPx, ...) |
| Close all dialogs | dismissActivePopup() (v8) | context.dismissAllPopups() - rootNavigator: defaults to TRUE here |
| Replace screen (named) | pReplacementNamed (v8) | context.pushReplacementNamedRoute(name) |
| Replace screen (widget) | pReplacement (v8) | context.pushReplacementPage(HomeScreen()) |
| Back respecting PopScope | maybePopPage (deprecated 9.2) | context.popPage([result]) - returns Future<bool> via maybePop |
| Back bypassing PopScope | - | context.forcePopPage([result]) - direct pop, guards NOT asked |
| Snapshot matching | when(loading:, error:, data:) | snapshot.when(none:, waiting:, active:, done:, error:) - see below |
| Unfocus keyboard | unFocus (v8) | context.unfocus() (also context.unfocusCall as a tear-off) |
| Route arguments | context.arguments | context.routeArgs<T>() (throws) / context.maybeRouteArgs<T>() (null) |
| Text scale | textScaleFactor | context.textScaler (Flutter's TextScaler) |
Naming convention: "Page" methods wrap a WIDGET in a MaterialPageRoute
(pushPage, pushReplacementPage, pushPageAndRemoveUntil,
pushPageAndClearStack); "Route" methods take a prebuilt Route
(pushRoute, ...); "NamedRoute" methods take a name string
(pushNamedRoute, ...). All accept rootNavigator: false by default
EXCEPT dismissAllPopups (root by default).
popPage = maybePop: PopScope/Page.canPop guards can veto.
forcePopPage = pop: guards are bypassed. tryPopPage pops only when
canPopPage is true - and canPopPage does NOT consult PopScope.popRoot() / tryPopRoot().popUntilNamed('/home'), popToRoot(), pushPageAndClearStack(screen).restorablePushNamedRoute, ...); a
RestorableRouteBuilder passed to them must be a STATIC function
annotated @pragma('vm:entry-point').context.themeData, context.textTheme, context.colorScheme,
context.brightness (THEME brightness) vs context.sysBrightness
(platform brightness from MediaQuery) - context.isDark/isLight
follow the THEME.context.themeData.primary,
.onSurface, .surfaceContainerHigh, ... (all ColorScheme roles).context.schemeColor('primary') returns Color?;
caseSensitive: false for lenient matching.context.themeExtension<MyTokens>() or
final (theme, tokens) = context.themeWithExtension<MyTokens>();context.appBarTheme,
context.cardTheme, context.dialogTheme, ...themeMode.getBrightness(context) resolves system/null via
sysBrightness.PlatformEnv (static, host truth, safe on web): PlatformEnv.isWeb,
.isMobile, .isDesktop, .isApple, .targetPlatform; web extras
.userAgent, .isSafari, .isChromium, .isWasm; .environment is
an EMPTY map on web, .operatingSystem works everywhere.context.targetPlatform reads Theme.of(this).platform - it follows a
theme platform OVERRIDE (tests, previews). context.isIOS,
context.isMobileWeb, context.isDesktopWeb, ... derive from it.PlatformEnv for capability decisions (file system, plugins);
use context.* for look-and-feel decisions that should respect the
theme's platform.snapshot.when(
none: (data) => const SizedBox.shrink(), // handlers get T? data
waiting: (data) => const CircularProgressIndicator(),
active: (data) => LiveView(data),
done: (data) => Result(data),
error: (error, stackTrace, state) => ErrorView(error),
);
snapshot.maybeWhen(orElse: () => const SizedBox.shrink(), done: (d) => Result(d));
isSuccess is true for completed Future<void> even though hasData
is false; dataOr(fallback) and mapData(transform) need non-null data.context.showSnackBar(SnackBar(...)),
showMaterialBanner, hideCurrentSnackBar, clearSnackBars.context.isRTL/isLTR, context.locale,
context.logicalPadding(start:, end:, ...),
context.directionAwareOffset(x, y), list.inContextDirection(context).16.edgeInsetsAll,
12.widthBox(), 8.heightBox(), 24.squareBox(), 8.allCircular
(BorderRadius), 8.circular (Radius), size.toSizedBox(),
0xFF2196F3.color (sugar import surface).String?.textSize measures one line with left-to-right direction and no
ambient context; null is empty text.MultiTapDetector(tapCount: 3, duration: ..., onTap: ..., child: ...)
for hidden/debug gestures (tapCount must be > 1). Duration controls a
rolling maximum gap between taps; timeout/completion/cancellation resets
progress and reports 0. A competing scroll cancels the tap sequence;
GradientWidget(gradient: ..., blendMode: BlendMode.srcIn, child: ...)
masks the child's pixels with a gradient.After edits: flutter analyze the touched paths and run the project's
tests. Undefined-member errors on names from this skill mean a pre-9
package version (see the migrate skill) or a wrong name.
PlatformTypeProvider, TypedListView/TypedSliverList,
or scroll-position work: use the
adaptive-ui-and-lists-with-flutter-helper-utils skill.Map-to-Color
conversion: use the colors-with-flutter-helper-utils skill.dart_helper_utils
or collection alongside the main FHU import - keep one provider.Complete per-domain member lists (theme getters, media query, navigation, scroll controller, carousel controller, platform, sugar, widgets): references/api-quick-reference.md.
dart_helper_utils
directly; state management/notifiers: better_value_notifier.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/adaptive-ui-and-lists-with-flutter-helper-utilsUse when building responsive/adaptive Flutter layouts or list UIs with the flutter_helper_utils package - PlatformTypeProvider setup, Breakpoint detection (watchBreakpoint/readBreakpoint, mobile/tablet/desktop), BreakpointLayoutBuilder, TypedListView/TypedSliverList, buildListView on iterables, pull-to-refresh, infinite scroll (onEndReached), item spacing/separators, empty states, or scrollCacheExtent tuning./colors-with-flutter-helper-utilsUse when Flutter code parses, converts, or manipulates colors with the flutter_helper_utils package - string-to-Color parsing (hex/rgb/hsl/hwb/named CSS), opacity and channel changes (setOpacity, setAlpha), darken/lighten/shade/tint, WCAG contrast and accessibility checks, color-blindness simulation, color harmonies, toHex output, or reading Colors from JSON/Map config (toColor, tryGetColor)./migrate-flutter-helper-utils-v8-to-v9Use when upgrading a Flutter project from flutter_helper_utils 8.x (or 7.x) to 9.x, or when code hits removed v8 APIs after a version bump - notifier utilities gone, addOpacity/addAlpha undefined, pReplacement/pNamed undefined, dataWhen undefined, core.dart/colors.dart/widgets.dart imports failing, or dart_helper_utils v6 conflicts./migrate-flutter-helper-utils-v9-to-v10Migrate apps from flutter_helper_utils 9.x to 10.x when Material types, theme or scaffold lookups, snackbar/banner helpers, page routes, or carousel controllers still use SDK Material. Covers material_ui imports, minimum SDK and dependency constraints, and legacy compatibility bridge limits./upgrade-flutter-helper-utilsUse when bumping the flutter_helper_utils package version in a project or auditing an upgrade's impact - detecting the installed version, sequencing migration hops across v7/v8/v8.5/v9/v10, patch-level bumps, or answering "is it safe to upgrade flutter_helper_utils".npx claudepluginhub omar-hanafy/flutter_helper_utils --plugin flutter-helper-utilsOther plugins' skills for the same job