From Flutter Helper Utils
Migrates Flutter projects from flutter_helper_utils v8 to v9, handling removed APIs like notifier utilities, color methods, navigation, and imports.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flutter-helper-utils:migrate-flutter-helper-utils-v8-to-v9The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Version 9 is a surface-cleanup release: notifier utilities were extracted,
Version 9 is a surface-cleanup release: notifier utilities were extracted,
deprecated aliases removed, navigation naming finalized, and the
dart_helper_utils dependency jumped to v6 (its own breaking migration).
Work through the sections in order; each has a detection grep.
>=3.11.0, Flutter >=3.41.0,
dart_helper_utils >=6.0.0 <7.0.0. A direct dependency pinning
dart_helper_utils <6 blocks resolution - upgrade it first.grep -A2 'flutter_helper_utils' pubspec.lock.
If coming from 7.x, ALSO apply the v8 hop (see step 8).dependencies:
flutter_helper_utils: ^9.2.0
flutter pub get. Solver conflicts almost always trace to a direct
dart_helper_utils or single_axis_wrap pin.
grep -rn "flutter_helper_utils/\(core\|colors\|widgets\).dart" lib/)core.dart, colors.dart, and widgets.dart were removed. Use the main
import; sugar.dart remains the opt-in shortcut surface:
import 'package:flutter_helper_utils/flutter_helper_utils.dart';
grep -rn "ValueNotifier\|Listenable" lib/ | grep -i "notifier")All notifier utilities moved to the better_value_notifier package. Add it
and import alongside:
dependencies:
better_value_notifier: ^1.0.0
import 'package:better_value_notifier/better_value_notifier.dart';
grep -rnE "\.add(Opacity|Alpha|Red|Green|Blue)\(|\.color\b" lib/)| Removed (v8) | v9 replacement |
|---|---|
color.addOpacity(0.5) | color.setOpacity(0.5) |
color.addAlpha(128) | color.setAlpha(128) |
color.addRed(255) / addGreen / addBlue | color.setRed(255) / setGreen / setBlue |
int.color | unchanged - lives in the sugar surface, which the main import re-exports |
SILENT behavior change: v9 corrected string color parsing for 4-digit and
8-digit hex and for hwb(...). #RGBA/#RRGGBBAA are now parsed in CSS
channel order (alpha LAST); 0x-prefixed strings keep Dart ARGB order
(alpha FIRST). Code that relied on the old, incorrect parsing changes
result colors without any compile error - re-verify any stored hex strings
with an alpha channel.
grep -rnE "\.p(Replacement|AndRemoveUntil|Named)|navigateTo|navigateByRouteName|dismissActivePopup" lib/)Wrappers on State and StatelessWidget were removed - all navigation is
on BuildContext now:
| Removed (v8) | v9 replacement |
|---|---|
state.navigateTo(route: r) | context.pushRoute(r) |
state.navigatePushReplacement(route: r) | context.pushReplacementRoute(r) |
state.navigateByRouteName('/x', args: a) | context.pushNamedRoute('/x', arguments: a) |
context.pReplacement(screen) | context.pushReplacementPage(screen) |
context.pAndRemoveUntil(screen, pred) | context.pushPageAndRemoveUntil(screen, pred) |
context.pNamed(name, arguments: a) | context.pushNamedRoute(name, arguments: a) |
context.pReplacementNamed(name) | context.pushReplacementNamedRoute(name) |
context.pNamedAndRemoveUntil(name, pred) | context.pushNamedRouteAndRemoveUntil(name, pred) |
context.dismissActivePopup() | context.dismissAllPopups() |
Also in 9.2: context.maybePopPage() is DEPRECATED (removal planned for
v10). Use context.popPage() (respects PopScope guards via maybePop)
or context.forcePopPage() (direct pop, bypasses guards).
grep -rnE "unFocus|dataWhen" lib/)context.unFocus() becomes context.unfocus() (lowercase f).snapshot.dataWhen(loading:, error:, success:) becomes snapshot.when:// Before (v8)
snapshot.dataWhen(
loading: () => const CircularProgressIndicator(),
error: (e) => Text('$e'),
success: (data) => Text('$data'),
);
// After (v9) - all five states, data param is nullable T?
snapshot.when(
none: (_) => const SizedBox.shrink(),
waiting: (_) => const CircularProgressIndicator(),
active: (_) => const CircularProgressIndicator(),
done: (data) => Text('$data'),
error: (error, stackTrace, state) => Text('$error'),
);
maybeWhen(orElse: ...) exists when only some states matter. Note: error
handling takes precedence over connection state.
grep -rn "gradientAlignment" lib/)The gradientAlignment parameter was removed. Position the gradient
through the Gradient itself (begin, end, center, radius).
SingleAxisWrap moved to the single_axis_wrap package
(renamed params: preferredDirection -> primaryDirection,
rowMainAxisAlignment -> horizontalAlignment with WrapAlignment,
etc. - full table in the repo's migration_guides.md). The
dart_helper_utils dependency also jumped to v5 there.TypedListView itemBuilder gained its current
(context, index, item) signature, and headerBuilder/footerBuilder
became direct header/footer widget slots.FHU 9.x re-exports dart_helper_utils v6. If the project uses those Dart
utilities directly (conversions, firstValueForKeys, altKeys:,
httpFormat, paginators, string casing), apply the DHU v5-to-v6 migration
too - if the dart-helper-utils plugin is installed, use its
migrate-dart-helper-utils-v5-to-v6 skill; otherwise follow
migration_guides.md in the dart_helper_utils repository.
dart pub get, then flutter analyze - every leftover v8 name surfaces
as an undefined-member error; fix using the tables above.flutter test and compare against the pre-migration baseline.PopScope-guarded back navigation.grep -rn "dart_helper_utils\|single_axis_wrap" pubspec.yaml pubspec.lock.flutter pub get;
no other state is touched until code edits begin.Full rename tables: references/v8-to-v9-api-mapping.md
npx claudepluginhub omar-hanafy/flutter_helper_utils --plugin flutter-helper-utilsAudits and sequences flutter_helper_utils upgrades across v7/v8/v8.5/v9, detecting installed version, applying migration hops, and running tests.
Atualiza dependências Flutter com análise de risco. Útil para migrações seguras de pacotes do pubspec.yaml.
Analyzes and safely updates Flutter/dart dependencies with risk evaluation and automated migration steps.