Skip to content

Conversation

@adil192
Copy link
Contributor

@adil192 adil192 commented Sep 9, 2025

Closes #198

The find.byIcon and find.widgetByIcon use this finder internally:

class _IconWidgetFinder extends MatchFinder { _IconWidgetFinder(this.icon, {super.skipOffstage}); final IconData icon; @override String get description => 'icon "$icon"'; @override bool matches(Element candidate) { final Widget widget = candidate.widget; return widget is Icon && widget.icon == icon; } }

This PR makes FaIcon extend Icon, reducing unnecessary code and allowing those finders to work.

Flutter test matchers expect an `Icon` type, so this satisfies that assumption while preserving the non-square aspect ratio. Reimplementing the finders is slightly more work and would be more confusing for consumers of the package imo.
@michaelspiss
Copy link
Collaborator

This is awesome on so many levels and something we probably should have done earlier. Thank you so much @adil192!

@michaelspiss michaelspiss merged commit 8a6dc47 into fluttercommunity:master Oct 18, 2025
@adil192 adil192 deleted the feat/fa-icon-finder branch October 18, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants