This package's use case is to provide access to the full library of Icons and FontAwesomeIcons at runtime when the specific icons needed are not known at compile time. As such, all Tree Shaking is totally worked around/defeated for Icons and FontAwesomeIcons, so know that before you use the library.
The methods you may want to consider using include:
getIconUsingPrefix(name: "PREFIX.ICON_NAME") - if PREFIX is "fa" or "fontawesome" the icon_name after the "." will be resolved against the font awesome icons first, if that fails, it'll go to Material Design Icons. If there is no PREFIX.ICON_NAME, it'll fail over to just trying to resolve Material First, then Font Awesome.
getIconGuessFavorFA(name:"ICON_NAME") - if there is an icon named ICON_NAME in FA, return that, otherwise, try Material
getIconGuessFavorMaterial(name:"ICON_NAME") - if there is an icon named ICON_NAME in Material Design, return that, otherwise, try FA
All methods will return null if icon doesn't exist.
I basically wrote this as a hack/work around to https://github.com/flutter/flutter/issues/16189.
Getting Started #
For help getting started with Flutter, view the online documentation.
[0.0.7] - Formatting, et al.
- Not any functional changes, just friendlier packaging items.
[0.0.1] - Initial release 29 July 2018.
- Just the basic functions.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: icons_by_name: ^0.1.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 17, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.0
- pana: 0.13.2
- Flutter: 1.12.13+hotfix.5
Health issues and suggestions
lib/icons_by_name.dart. (-57.81 points)
lib/icons_by_name.dart failed with 3 errors:
line 840 col 21: Const variables must be initialized with a constant value.
line 840 col 21: The values in a const map literal must be constant.
line 840 col 38: The getter 'nintendoSwitch' isn't defined for the class 'FontAwesomeIcons'.
Document public APIs. (-1 points)
8 out of 8 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
Maintenance issues and suggestions
Homepage URL doesn't exist. (-20 points)
At the time of the analysis the
https://github.com/HeyYouNotYouYou/icons_helper was unreachable.
Package is getting outdated. (-11.51 points)
The package was last published 58 weeks ago.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
icons_by_name.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=1.19.0 <3.0.0|