Skip to content

Conversation

adil192
Copy link

@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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default finders from flutter_test don't work with FaIcon
1 participant