You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If I generate my dynamic icon mapping file name_icon_mapping.dart while excluding the regular font it will lead into an error during build time.
If no icon with the corresponding css class is found, the method getIconFromCss will return FontAwesomeIcons.circleQuestion as a default.
To Reproduce
Steps to reproduce the behavior:
Generate dynamic icon mapping without the the regular font $ configurator.sh --dynamic --exclude regular
Import mapping file in your widgets import 'package:font_awesome_flutter/name_icon_mapping.dart';
Build your app
See error font_awesome_flutter/lib/name_icon_mapping.dart:36:26: Error: Member not found: 'circleQuestion'.
Expected behavior
The method generating the code for getIconFromCss should have some kind of fallback behavior to use an icon from an available font. Maybe regular -> solid -> light -> thin?
Even better would be to include a custom icon that's obviously broken / not from font awesome to avoid the very small problem if I want to include circle-question and something is wrong.
The text was updated successfully, but these errors were encountered:
Hi @timkandel and thanks for the feedback! I changed the function so it returns null if no icon is found. This way everyone can decide themselves how to treat missing icons by simply wrapping the function like
IconDatacustomGetIconFromCss(String cssClasses) {
returngetIconFromCss(cssClasses) ??FontAwesomeIcons.circleQuestion; // FontAwesomeIcons.circleQuestion being the placeholder icon here
}
This is definitely a much better solution that also eliminates the issue.
Describe the bug
If I generate my dynamic icon mapping file
name_icon_mapping.dart
while excluding the regular font it will lead into an error during build time.If no icon with the corresponding css class is found, the method
getIconFromCss
will returnFontAwesomeIcons.circleQuestion
as a default.To Reproduce
Steps to reproduce the behavior:
$ configurator.sh --dynamic --exclude regular
import 'package:font_awesome_flutter/name_icon_mapping.dart';
font_awesome_flutter/lib/name_icon_mapping.dart:36:26: Error: Member not found: 'circleQuestion'.
Expected behavior
The method generating the code for
getIconFromCss
should have some kind of fallback behavior to use an icon from an available font. Maybe regular -> solid -> light -> thin?Even better would be to include a custom icon that's obviously broken / not from font awesome to avoid the very small problem if I want to include circle-question and something is wrong.
The text was updated successfully, but these errors were encountered: