0 purchases
string 2 icon
String 2 Icons Flutter #
This package convert a string to an IconData to show its icon representation. Currently only working with Material Design Icons.
Instalation #
Include string_2_icon in your pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
string_2_icon: version
copied to clipboard
Usage #
To use this package, just import it into your file and enjoy it.
import 'package:string_2_icon/string_2_icon.dart';
...
Icon(String2Icon.getIconDataFromString('mdiAccountArrowDown'))
Icon(String2Icon.getIconDataFromString('account-details'), size: 48)
Icon(String2Icon.getIconDataFromString('account_key'), size: 48, color: Colors.blue,)
Icon(String2Icon.getIconDataFromString('alarm.panel'), color: Colors.red,)
...
copied to clipboard
The method getIconDataFromString can return an IconData or null. You can use dash (-), underscore(_), dot(.) or include mdi preffix on the icon string name.
NOTE: Remember to install the Material Design Icons before use this package.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.