fix!: support Flutter 3.43+ IconData final-class change#62
Open
subarnaPdl wants to merge 1 commit into
Open
Conversation
Comm4nd0
added a commit
to Comm4nd0/luma-support
that referenced
this pull request
May 20, 2026
phosphor_flutter 2.1.0 (the latest on pub.dev, May 2024) extends
Flutter's `IconData`, which 3.43+ sealed as `final`. Building against
Flutter 3.44 fails the kernel_snapshot Dart AOT step with:
phosphor_icon_data.dart:5:32: Error: The class 'IconData' can't be
extended outside of its library because it's a final class.
class PhosphorIconData extends IconData {
Upstream PR #62 turns PhosphorIconData into a typedef for IconData but
has been open with no maintainer response since May 2026, and the
package's last release is from May 2024 — effectively unmaintained.
Pin phosphor_flutter to the PR author's fork at a specific commit SHA
via dependency_overrides so the lockfile stays reproducible. None of
the removed classes (PhosphorFlatIconData, PhosphorDuotoneIconData)
are referenced by the app — only PhosphorIcon, PhosphorIconsDuotone,
and duotoneSecondaryColor, all of which the fork keeps API-compatible.
Drop the override when upstream publishes a fixed version (or when we
migrate to a maintained icon library).
phosphor-icons/flutter#61
phosphor-icons/flutter#62
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #61.
Problem
Flutter 3.43 marks
IconDataas afinalclass (breaking change), which breaks the current inheritance hierarchy:This affects:
PhosphorIconDataPhosphorFlatIconDataPhosphorDuotoneIconDataThe package currently fails to compile on Flutter 3.43+.
Approach
This PR migrates the package away from
IconDatainheritance while preserving the existing public usage patterns as much as possible.API compatibility
PhosphorIconDatais now a typedef toIconData.PhosphorFlatIconDataandPhosphorDuotoneIconDatahave been removed.IconDatainstances.PhosphorIconstill extendsIcon, so APIs such asfind.byIcon,find.widgetWithIcon, andIconThemeintegration continue to work unchanged.PhosphorIconuses this lookup internally to render the secondary glyph automatically for duotone icons.Breaking changes
PhosphorFlatIconData.PhosphorDuotoneIconData.PhosphorIconData(int codePoint, String style)constructor.Iconwidget will display only the foreground glyph.PhosphorIconcontinues to render both layers automatically.The following continue to work unchanged:
Icon(PhosphorIcons.x())Icon(PhosphorIconsRegular.x)PhosphorIcon(...)find.byIcon(...)find.widgetWithIcon(...)List<IconData>Generator
bin/generate_package_icons.dartupdated to emit the new forms. Regenerating reproduces the committed icon files.bin/pubspec.yamlSDK constraint bumped to>=3.0.0(the generator itself no longer runs on Dart 2.x because of upstreamarchiveandhttpbreaking changes).Not included
CHANGELOG.mdupdates. Existing changelog entries appear to be maintainer-managed.