Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Flutter Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-flutter-knowledge-patch-nevaberry-plugins)
---
name: flutter-knowledge-patch
description: Flutter
version: "3.50"
license: MIT
metadata:
author: Nevaberry
---
# Flutter compatibility guidance
Load this skill when migrating Flutter applications or packages, configuring
platform integration and builds, or using the Dart language and tooling below.
Use the topic references for complete guidance, examples, and version-specific
behavior. Experimental and upcoming features retain those qualifications there.
## Reference index
| Reference | Topics |
| --- | --- |
| [Migrations and breaking changes](references/migrations-and-breaking-changes.md) | Standalone design libraries, compatibility bridge, localizations, framework types, package support |
| [Widgets and theming](references/widgets-and-theming.md) | Theme data, forms, dropdowns, menus, tooltips, Cupertino controls, fonts |
| [Navigation, layout, and animation](references/navigation-layout-and-animation.md) | Route completion, predictive back, sheets, overlays, scrolling, animation |
| [Accessibility, input, and testing](references/accessibility-input-and-testing.md) | Semantics, focus, announcements, selection, text input, test lifecycle |
| [Android](references/android.md) | SDK and build tools, Kotlin, ABI filters, rendering, platform views |
| [Apple platforms](references/apple-platforms.md) | Deployment targets, UIScene, SwiftPM, signing, iOS integration |
| [Desktop and embedding](references/desktop-and-embedding.md) | Thread merging, native hosts, experimental windows, desktop builds, custom devices |
| [Dart language](references/dart-language.md) | Constructors, wildcards, dot shorthands, inference, extension types, documentation imports |
| [Dart tooling and packages](references/dart-tooling-and-packages.md) | Formatting, analyzer plugins, dependencies, workspaces, build hooks, publishing |
| [Flutter tooling, builds, assets, and plug-ins](references/tooling-build-assets-and-plugins.md) | Build migrations, assets, previews, DevTools, MCP, AI integrations, SDK installation |
| [Web, rendering, and graphics](references/web-rendering-and-graphics.md) | Web bootstrap and development, Wasm, hosting, shaders, graphics backends |
## Migrate bundled design libraries
The SDK's bundled Material and Cupertino libraries are formally deprecated.
The standalone `material_ui` and `cupertino_ui` packages provide an opt-in
migration. Rewrite SDK design-library imports with:
```sh
dart fix --apply --code=migrate_design_widgets
```
If the dependency update fails, add the packages you use with
`flutter pub add material_ui` or `flutter pub add cupertino_ui`, then rerun the
fix. For published packages, ship the migration as a major release.
If a dependency still imports SDK Material, wrap the app's routed content in
`MaterialUiCompatibilityBridge` from `package:material_ui/material_ui.dart`.
With standalone Material, use `GlobalMaterialLocalizations.delegates` from that
library; the list includes Material, Cupertino, and Widgets delegates.
## Update framework APIs and callbacks
- Use `CardThemeData`, `DialogThemeData`, and `TabBarThemeData` for the
corresponding `ThemeData` slots. Use `AppBarThemeData`, `BottomAppBarThemeData`,
and `InputDecorationThemeData` for their slots.
- Replace `ExpansionTileController` with `ExpansibleController`. Configure
`Expansible` animation timing and curves together through `AnimationStyle`.
- Replace `ReorderableListView.onReorder` with `onReorderItem`. Remove the item at
`oldIndex` and insert it directly at `newIndex`, including for downward moves.
- In separated lists, replace `findChildIndexCallback` with
`findItemIndexCallback`, returning an index that counts only items.
- Migrate `cacheExtent` and `cacheExtentStyle` settings to `ScrollCacheExtent`.
- On `DropdownButtonFormField`, replace `value: selected` with
`initialValue: selected` for the starting selection.
- Replace `InputDecoration(maintainHintHeight: ...)` with
`InputDecoration(maintainHintSize: ...)`.
- Replace `describeEnum(value)` with `value.name` for an enum value.
`PipelineOwner` is a Dart `base` class: external subclasses must be `base`,
`final`, or `sealed`; implementations must extend it or use composition.
`IconData` is `final`; create custom icon definitions as constants and use
composition for additional metadata.
`DropdownMenu` accepts nullable type arguments again in Flutter 3.44, reverting
the 3.41 restriction. `RawMenuAnchor` close callbacks changed order; consult the
reference before relying on callback sequencing.
## Update build scripts and generated files
- Declare each imported package in the app's `pubspec.yaml`. Assets and plugins
are bundled only from its transitive dependency graph. Remove the
`--explicit-package-dependencies` option and its opt-out from scripts.
- Migrate away from synthetic `package:flutter_gen`: use
`synthetic-package: false`, import `app_localizations.dart` from the configured
output directory, and enable `flutter: {generate: true}`. Remove remaining
`synthetic-package: true` settings.
- Replace `.flutter-plugins` consumers with `.flutter-plugins-dependencies`.
Remove `pluginClass: none` from platform entries with no native code. Omit
`dartPluginClass` when there is no Dart registration class; explicit
`dartPluginClass: none` produces a warning.
- Read `bin/cache/flutter.version.json` instead of the SDK root `version` file.
Builds omit `AssetManifest.json` by default.
- Remove SkSL bundle inputs such as `--bundle-sksl-path`.
- Use `--no-dds` instead of `--disable-dds`, and `--dds` instead of
`--no-disable-dds`.
- For `flutter assemble`, use `--dart-define=APP_ENV=staging` or
`-D APP_ENV=staging`; `--define` and `-d` are deprecated.
## Apply platform migrations
Flutter 3.47 raises deployment minimums to iOS 15 and macOS 12. UIKit apps built
with Xcode 27 fail at launch with the legacy lifecycle. Flutter migrates most
projects during builds; custom native `AppDelegate` code and plugins relying
on the legacy lifecycle require manual migration to `UIScene`.
Building or running an iOS or macOS app automatically migrates its Xcode project
to Swift Package Manager. Flutter warns and falls back to CocoaPods for plugins
that still require it. The Apple reference includes manual integration, removal,
custom targets, and configuration regeneration after raising deployment targets.
When migrating to AGP 9's built-in Kotlin, remove the separate Kotlin Gradle
plugin and migrate dependencies that still apply it before switching the app.
Set `environment.flutter: '>=3.44.0'` in the pubspec of a migrated Flutter plugin.
Set `disable-abi-filtering=true` when preserving product-flavor or build-type
`abiFilters`; see the Android reference for the version-specific build settings.
Impeller is mandatory on iOS; the engine ignores its `FLTEnableImpeller` opt-out.
Desktop Impeller defaults and opt-outs, and Android renderer fallbacks, are
documented with their SDK versions in the rendering and Android references.
## Complete routes and coordinate overlays
`NavigatorState.removeRoute` calls `didComplete`, so an awaiting push future
resumes. Use `navigator.removeRoute(route, result)` to return a value. In custom
transition delegates, use `record.markForComplete()` when the route should
complete as it leaves the navigator. Use `Navigator.popUntilWithResult` to unwind
multiple routes and return a value to the destination.
`OverlayPortal.overlayChildLayoutBuilder` provides child layout information for
overlay placement. Replace `OverlayPortal.targetsRootOverlay` with
`OverlayPortal(overlayLocation: OverlayChildLocation.rootOverlay, ...)`.
For scrollable Cupertino sheets, replace `showCupertinoSheet.builder` and
`CupertinoSheetRoute.pageBuilder` with `scrollableBuilder`; pass its supplied
`ScrollController` to the scrollable to coordinate scrolling and sheet dragging.
## Configure forms, focus, and accessibility
Use `FormField.errorBuilder` for custom error widgets and `FormField.onReset`
for field-specific reset state. `AutovalidateMode.onUserInteractionIfError`
revalidates on interaction once a field has an error. Call
`formKey.currentState?.clearError()` to clear errors while keeping field values.
Set `maintainState: true` whenever `Visibility.maintainFocusability` is true.
Use `Semantics(blockAccessibilityFocus: true, child: child)` to block accessibility
focus; `Semantics.hitTestBehavior` controls accessibility hit testing.
Android API 36 deprecates explicit announcement events. Use
`Semantics(liveRegion: true, child: Text(status))` for polite status announcements,
accounting for the Flutter 3.32 limitation when announcements must stay outside
accessibility focus. In widget tests, migrate `containsSemantics` to `isSemantics`
and use `accessibilityAnnouncement` to match emitted announcements.
## Develop and deploy web apps
Chrome and `web-server` debug runs enable stateful hot reload by default. Remove
obsolete explicit enable flags as described in the web reference. Configure the
development server and proxy in `web_dev_config.yaml`; command-line headers and
HTTPS settings take precedence over their file counterparts.
The generated service worker cleans up its own registration and `--pwa-strategy`
is deprecated. Supply a custom service worker if the app relies on offline
caching. Use `--web-content-hash` to give built web assets content hashes.
Before enabling Wasm on older projects, update `web/index.html` to the Flutter
3.22-and-later initialization scheme. Use `dart:js_interop` and `package:web`
when migrating deprecated web libraries to Wasm-compatible implementations.
`--no-deprecated-js-interop` disables deprecated JavaScript interop in web builds.
Wasm can run single-threaded with standard headers. For threaded rendering, pair
`Cross-Origin-Opener-Policy: same-origin` with `Cross-Origin-Embedder-Policy` set
to `credentialless` or `require-corp`. Exercise isolation in development with:
```sh
flutter run -d chrome --wasm --cross-origin-isolation
```
Release Wasm builds strip debug symbols and omit source maps by default.
`--source-maps` generates `main.dart.wasm.map`; `--no-strip-wasm` retains function
names in browser stack traces. Check the web reference for browser limitations,
compiler dependency paths, and experimental main-channel deferred loading.
## Use Dart language and tooling updates
At Dart language version 3.7, `_` local variables and parameters introduce no
binding. Rename declarations whose values you read; top-level variables and
members retain their existing behavior.
After raising the SDK lower bound, run `dart pub get` before `dart format`,
including in CI. Use `formatter.page_width` in `analysis_options.yaml` to set
the new formatter's project width. `dart fix` replaces `dart format --fix`.
Primary constructors and concise `new` and `factory` declarations are stable in
Dart 3.13. Moving off the 3.12 experiment requires raising the package language
version through its SDK constraint and dropping
`--enable-experiment=primary-constructors` from commands.
Register analyzer plugins under top-level `plugins` in `analysis_options.yaml`.
Plugin warnings are enabled by default; lint rules are opt-in under each plugin's
`diagnostics`. Restart the Dart Analysis Server after changing the configuration.
Build hooks live in `hook/build.dart`. Direct dependencies' hooks run first;
read their outputs through `input.assets` and `input.metadata`. Packages using
hooks cannot form dependency cycles. Store generated and downloaded files in
`input.outputDirectoryShared`.
## Preview widgets and inspect running apps
Widget previews are stable. Annotate factories with `@Preview()` and run
`flutter widget-preview start`. Use `size: Size(width, height)` instead of separate
height and width arguments. Preview dependencies may import `dart:ffi` and
`dart:io`, but calling those APIs displays an error; provide web-compatible
implementations with conditional imports.
The stable Dart SDK includes the experimental Dart and Flutter MCP server.
Connected clients can inspect a running widget tree, analyze code, manage
dependencies, discover running apps, and trigger hot reload. The tooling
reference covers package-file reads and dependency searches through MCP.