Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Image to IconData flutter

Tags:

flutter

I know there is a way to convert image to Icon via ImageIcon. But I'm using FancyBottomNavigation which is required TabData that has parameter iconData type IconData. Is there anyway to convert image to IconData.

like image 309
Phuoc Avatar asked Jan 22 '21 07:01

Phuoc


1 Answers

You can easily use svg as IconData using FlutterIcon (Custom Icon Generator). Follow these steps :

  1. Go to FlutterIcon.com

  2. Drag and drop all your Icons

  3. Give a class name (Let's say CustomIcons)

  4. Download and Unzip.

  5. Copy fonts folder to your app folder and add the fonts as you add a normal font in flutter. (See here how to add a custom font).

  6. Copy custom class CustomIcons that we generated to your lib directory.

  7. Use CustomIcons as IconData :

    Icon(CustomIcons.hamburger)

like image 60
Shubhamhackz Avatar answered Nov 10 '22 20:11

Shubhamhackz