From Flutter Helper Utils
Guides correct usage of the flutter_helper_utils package v9: context extensions, MediaQuery shortcuts, navigation helpers, platform detection, and import decisions between the main package and sugar.dart.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flutter-helper-utils:use-flutter-helper-utilsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
flutter_helper_utils (FHU) is a curated Flutter utility package. Agents
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, 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, or convert_object 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 9.x. 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.| 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).MultiTapDetector(tapCount: 3, duration: ..., onTap: ..., child: ...)
for hidden/debug gestures (tapCount must be > 1);
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.npx claudepluginhub omar-hanafy/flutter_helper_utils --plugin flutter-helper-utilsProvides Flutter framework knowledge including widgets, state management, layout, navigation, and Material Design components for building mobile, web, and desktop apps.
Migrates Flutter projects from flutter_helper_utils v8 to v9, handling removed APIs like notifier utilities, color methods, navigation, and imports.
Provides Flutter/Dart guidance on architecture (BLoC, Riverpod), state management, widgets, navigation (GoRouter), data (Dio, Hive), performance, and testing for cross-platform mobile apps.