Skip to content

A Flutter package to generate IconData from a string. Currently only working with Material Design Icons

License

Notifications You must be signed in to change notification settings

ajomuch92/string_2_icon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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,)
...

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.

About

A Flutter package to generate IconData from a string. Currently only working with Material Design Icons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages